Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 32 lines (24 sloc) 0.954 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
################ Cotonti Handy URLs for Nginx #######################

# Below are the rules to be included in your nginx.conf
# inside the "location / { ... }" section
# If you run Cotonti in a subfolder, prepend it to all paths below, e.g.
# rewrite "^/my/path/to/(datas|...." /my/path/to/$1...

# File protection
location ~ \.(tpl|dat)$ {
    deny all;
}

# Language selector
rewrite "^/(en|ru|de|nl)/(.*)" /$2?l=$1;

# Sitemap shortcut
rewrite ^/sitemap\.xml$ /index.php?r=sitemap last;

# Protect standard .php URLs
rewrite "^/([a-z]+)\.php(.*)$" /$1.php$2 last;

# Admin area and message are special scripts
rewrite "^/admin/([a-z0-9]+)" /admin.php?m=$1 last;
rewrite "^/(admin|login|message)(/|\?|$)" /$1.php last;

# System category has priority over /system folder
rewrite "^/system/?$" /index.php?rwr=system last;

# All the rest goes through standard rewrite gateway
if (!-e $request_filename) {
rewrite "^/([^?]+)" /index.php?rwr=$1 last;
}
Something went wrong with that request. Please try again.