nginx rewrite rules tutorial

Rewrite rules for Zenphoto 1.4.5+

Nginx rules for Zenphoto 1.4.5 have been greatly simplified. In your server { } block, add:

location / {
    try_files $uri $uri/ /index.php?$args;

Or for a subdirectory:

location /subfolder {
    try_files $uri $uri/ /subfolder/index.php?$args;

To redirect URLs that do not end in a slash, add this inside the location block above (optional):

rewrite ^([^\.]*[^/])$ $1/ permanent;

Rewrite rules for older releases:


A Zenphoto plugin for the MediaElement.js HTML 5 video/audio player.


A Zenphoto plugin to embed maps from Google Maps or OpenStreetMap via content macros.


A plugin to embed content from various services via oEmbed using a content macro. An adaption of Felix Girault's OEmbed libary Essence.

PHP 5.4+ required! 

Support for the following providers: 23hq, Bandcamp,, Cacoo, CanalPlus,, Clikthrough, CollegeHumour, Dailymotion, Deviantart, Dipity, Flickr, Funnyordie, Howcast, Huffduffer, Hulu, Ifixit, Imgur, Instagram, Mobypicture,, Polldaddy, Qik, Revision3, Scribd, Shoudio, Sketchfab, Slideshare, SoundCloud, Ted, Twitter, Vhx, Viddler, Vimeo, Yfrog and Youtube.


A simple plugin that provides a function to display an archive listing the titles of albums and news articles by year and month as an nested unordered html list. The years can be folded out via jQuery.


Provides extra functionality for numbererd pagelist of single gallery items (single image, album and Zenpage news article and pages) similar to the standard template pagination functions.


A plugin to provide provide various content macros for Zenpage CMS items.


Zenphoto plugin to attach an image from the gallery to a Zenpage article, category or page as an "featured image".


A Zenphoto plugin that enables touch screen left and right swiping for:

  • next/prev single image
  • next/prev album page
  • next/prev news loop page ("news on index" option not supported)

Based on the jQuery plugin touchSwipe


Preload the previous/next images on the single image page to speed up loading.