Skip to content

Instantly share code, notes, and snippets.

@markahesketh
Created February 10, 2012 09:48
Show Gist options
  • Save markahesketh/1788142 to your computer and use it in GitHub Desktop.
Save markahesketh/1788142 to your computer and use it in GitHub Desktop.
location / {
index index.php;
# serve static files directly
if (-f $request_filename) {
access_log off;
expires 30d;
break;
}
### BACKEND
if ($request_filename ~ /symphony/) {
rewrite ^/symphony/?$ /index.php?mode=administration&$query_string last;
rewrite ^/symphony(/(.*/?))?$ /index.php?symphony-page=$1&mode=administration&$query_string last;
}
### IMAGE RULES
rewrite ^/image/(.+\.(jpg|gif|jpeg|png|bmp|JPG|GIF|JPEG|PNG|BMP))$ /extensions/jit_image_manipulation/lib/image.php?param=$1 last;
## Add trailing slash
rewrite ^(.*[^/])$ $1/ permanent;
### MAIN REWRITE - This will ignore directories
if (!-d $request_filename) {
rewrite ^/(.*)$ /index.php?symphony-page=$1 last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment