forked from jbogdani/BraDyCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
executable file
·71 lines (52 loc) · 2.31 KB
/
.htaccess
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
RewriteEngine on
RewriteBase /
# robots
RewriteRule ^robots.txt$ controller.php?obj=seo_ctrl&method=robots
#sitemap
RewriteRule ^sitemap.xml$ controller.php?obj=seo_ctrl&method=sitemap
# www to non-www url syntax
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#safe site, js and css, tiny_mce
RewriteRule (css|sites|js|tiny_mce|img|xsl|fonts)/(.+) $1/$2
RewriteRule ^feed/rss$ controller.php?obj=feeds_ctrl&method=rss2 [QSA,L]
RewriteRule ^feed/atom$ controller.php?obj=feeds_ctrl&method=atom [QSA,L]
#OAI
RewriteRule ^(OAI|oai)$ controller.php?obj=OAI_ctrl&method=run [QSA,L]
#api
RewriteRule ^(api|API)/?(.+)$ controller.php?obj=api_ctrl&method=run&$1 [QSA,L]
#admin
RewriteRule ^admin/?$ admin.php
#safe home page
RewriteRule ^([a-z]{2})/?$ index.php?lang=$1 [L]
#tags
RewriteRule ^([a-z]{2})/([a-zA-Z0-9-_+~]+)\.all$ index.php?lang=$1&tags=$2 [QSA,L]
RewriteRule ^([a-zA-Z0-9-_+~]+)\.all$ index.php?tags=$1 [QSA,L]
#art_title no html
RewriteRule ^([a-z]{2})/([a-zA-Z0-9-_]+)/?$ index.php?lang=$1&art_title=$2 [QSA,L]
RewriteRule ^([a-zA-Z0-9-_]+)/?$ index.php?art_title=$1 [QSA,L]
#art_title with html extension
RewriteRule ^([a-z]{2})/([a-zA-Z0-9-_]+).html$ index.php?lang=$1&art_title=$2 [QSA,L]
RewriteRule ^([a-zA-Z0-9-_]+).html$ index.php?art_title=$1 [QSA,L]
#art_title, draft
RewriteRule ^([a-z]{2})/([a-zA-Z0-9-_]+).draft$ index.php?lang=$1&art_title=$2&draft=1 [L]
RewriteRule ^([a-zA-Z0-9-_]+).draft$ index.php?art_title=$1&draft=true [L]
#search
RewriteRule ^([a-z]{2})/search:([a-zA-Z0-1-_\.\s]+)$ index.php?lang=$1&search=$2 [L]
RewriteRule ^search:([a-zA-Z0-9-_\.\s]+)$ index.php?search=$1 [L]
#search tags
RewriteRule ^([a-z]{2})/([a-zA-Z0-9-_+~]+).search$ index.php?lang=$1&tags=$2&is_search=1 [L]
RewriteRule ^([a-zA-Z0-9-_+~]+).search$ index.php?tags=$1&is_search=1 [L]
#all non existing, non image content to index.php http://jrgns.net/redirect_request_to_index/
RewriteCond %{REQUEST_URI} !\.(gif|jpg|png)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php?art_title=not_found [L]
#ErrorDocument 404 /index.php?art_title=not_found
<FilesMatch "\.(htaccess|htpasswd|ini|log|inc|bak|sqlite|json)$">
order allow,deny
deny from all
</FilesMatch>
<FilesMatch "\.(png|jpg|jpeg|gif)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>