forked from opencaching/opencaching-pl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
61 lines (44 loc) · 2.56 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
RewriteEngine on
FileETag None
# redirect empty requests / -> public/index.php
RewriteRule ^$ /public/index.php [L,NC]
# Deny access to .git directory
RewriteRule "(^|/)\.git" - [F]
# IF the file exists or dir exists THEN just go there
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule .* - [L,NC,PT,QSA]
# IF the file or dir exists in /public THEN just go /public
RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -d
RewriteRule .* /public%{REQUEST_URI} [L,NC,PT,QSA]
# redirect "old style" registration requests
RewriteRule ^register.php$ /UserRegistration [R=301,R,L]
RewriteRule ^search\.(gpx|kml|loc|ov2|ovl|txt|wpt|uam|xml|zip|ggz)$ /search.php?%{QUERY_STRING} [L,NC]
RewriteRule ^ocpl(\d+)\.(gpx|kml|loc|ov2|ovl|txt|wpt|uam|xml|zip|ggz|jsoncodes)$ /search.php?queryid=$1&output=$2&%{QUERY_STRING} [L,NC]
RewriteRule ^ocplgpx(\d+)\.(gpx)$ /search.php?queryid=$1&output=gpxgc&%{QUERY_STRING} [L,NC]
# statPic - used for backward compatibility
RewriteRule ^statpics/([0-9]+)\.jpg$ /stats/statPic/$1 [R,L]
# redirect requests like /OP123F to viewcache page
RewriteRule ^(O[A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z])$ /viewcache.php?wp=$1 [R=301,L,NC]
# redirect from old tinyMCE emoticons to the new location of emoticons
RewriteRule ^lib/tinymce4/plugins/emoticons/img/smiley-([a-z-]+)\.gif$ /public/images/emoticons/fromTinyMce/smiley-$1.gif [NC,L]
# Remap old /rss directory into new RSS controller
RewriteRule ^rss/newcaches\.xml$ %{DOCUMENT_ROOT}/RSS/newCaches [L]
RewriteRule ^rss/newnews\.xml$ %{DOCUMENT_ROOT}/RSS/newNews [L]
RewriteRule ^rss/newlogs\.xml$ %{DOCUMENT_ROOT}/RSS/newLogs [L]
RewriteRule ^rss/my_logs\.xml$ %{DOCUMENT_ROOT}/RSS/myLogs [L]
RewriteRule ^rss/mycaches_logs\.xml$ %{DOCUMENT_ROOT}/RSS/myCachesLogs [L]
# permanentely block Wordpress login page - too many such requests
RewriteRule ^wp-login.php "-" [F]
# redirect the all OTHER requests -> /public/index.php
RewriteRule ^(.*)$ /public/index.php?r=$1 [NC,L,QSA,B,NE,PT]
# To be sure: apache site config should contains also aliases:
# /images/uploads/ -> */ocpl-dynamic-files/images/uploads/
# /uploads/ -> */ocpl-dynamic-files/images/uploads/
# /wigo/ -> */ocpl-dynamic-files/wigo/
# /download/ -> */ocpl-dynamic-files/download/
# /images/statpics/ -> */ocpl-dynamic-files/images/statpics/
# /images/mini-mapa/ -> */ocpl-dynamic-files/images/mini-mapa/
# /mp3/ -> */ocpl-dynamic-files/mp3/
# /tmp/ -> */ocpl-dynamic-files/tmp/