FAQ

Page Discussion History

ZenPhoto

Revision as of 06:02, 23 November 2010 by MichaelLustfield (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ZenPhoto Gallery needs a few rewrite rules, I was lucky to find that Matt Martz had done all the hard work already.

location / {
	index	index.php;

	rewrite ^/admin/?$ /zp-core/admin.php redirect;

	if (-d $request_filename) {
		rewrite ^/albums/?(.+/?)?$  /$1  redirect;
	}

	if (-e $request_filename) {
		break;
	}

	rewrite index\.php$  /index.php  last;
	rewrite ^/page/([0-9]+)/?$  /index.php?page=$1  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/?$  /index.php?p=$1  last;
	rewrite ^/(.*)/page/([0-9]+)/?$  /index.php?album=$1&page=$2  last;
	rewrite ^/(.*)page/([A-Za-z0-9\-_]+)/?$  /index.php?album=$1&p=$2  last;

	rewrite ^/page/([A-Za-z0-9\-_]+)/fields([0-9]+)/(.*)/([0-9]+)/?$  /index.php?p=$1&searchfields=$2&words=$3&page=$4  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/fields([0-9]+)/(.*)/?$  /index.php?p=$1&searchfields=$2&words=$3  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/archive/(.*)/([0-9]+)/?$ /index.php?p=$1&date=$2&page=$3  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/archive/(.*)/?$  /index.php?p=$1&date=$2  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/tags/(.*)/([0-9]+)/?$  /index.php?p=$1&searchfields=4&words=$2&page=$3  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/tags/(.*)/?$  /index.php?p=$1&searchfields=4&words=$2  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/(.*)/([0-9]+)/?$ /index.php?p=$1&words=$2&page=$3  last;
	rewrite ^/page/([A-Za-z0-9\-_]+)/(.*)/?$  /index.php?p=$1&words=$2  last;

	rewrite "^/(.*)/image/(thumb|[0-9]{1,4})/([^/\\\]+)$"  /zp-core/i.php?a=$1&i=$3&s=$2  last;
	rewrite ^/(.*)/image/([^/\\\]+)$  /zp-core/i.php?a=$1&i=$2  last;
	rewrite "^/(.*)/album/(thumb|[0-9]{1,4})/([^/\\\]+)$"  /zp-core/i.php?a=$1&i=$3&s=$2&album=true  last;

	rewrite ^/(.*)/?$  /index.php?album=$1  last;
}

In the Gallery Admin page I have set :-

  • Admin / Options / Mod ReWrite = On
  • Admin / Options / mod_rewrite suffix = Empty