-
Notifications
You must be signed in to change notification settings - Fork 2
/
sef-urls.nginx.conf
34 lines (25 loc) · 998 Bytes
/
sef-urls.nginx.conf
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
33
34
################ 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|inc)$ {
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;
}
add_header X-Frame-Options SAMEORIGIN;