forked from smogon/pokemon-showdown-client
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htaccess
100 lines (80 loc) · 3.44 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# -FrontPage-
#IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AddType text/plain .phps
AddType application/x-tgz .tgz
AddType application/x-chrome-extension .crx
AddType application/x-web-app-manifest+json .webapp
<IfModule mod_rewrite.c>
RewriteEngine on
# Send bingbot a `noindex` header on every page.
RewriteCond %{HTTP_USER_AGENT} bingbot
RewriteRule ^(.*) - [E=BINGBOT:1]
Header set X-Robots-Tag "noindex" env=BINGBOT
Header unset Vary env=BINGBOT
# Redirect dev.pokemonshowdown.com to beta.psim.us
# RewriteCond %{HTTP_HOST} ^(www\.)?dev\.pokemonshowdown\.com$ [NC]
# RewriteCond %{REMOTE_ADDR} !^69\.85\.87\.173$
# RewriteCond %{REMOTE_ADDR} !^173\.213\.97\.68$
# RewriteCond %{REMOTE_ADDR} !^173\.252\.196\.254$
# RewriteCond %{REQUEST_URI} ^/$ [OR]
# RewriteCond %{REQUEST_URI} ^/robots\.txt$ [OR]
# RewriteCond %{REQUEST_URI} ^/(teambuilder|ladder|lobby|battle)/?$ [OR]
# RewriteCond %{REQUEST_URI} ^/(lobby|battle)-([A-Za-z0-9-]*)$
# RewriteRule ^(.*) http://beta.psim.us/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.play\.pokemonshowdown\.com$ [NC]
RewriteRule ^(.*) http://play.pokemonshowdown.com/$1 [R=301,L]
#RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
#RewriteCond %{REMOTE_ADDR} !^69\.85\.87\.173$
#RewriteRule ^(.*) https://play.pokemonshowdown.com/$1 [R=301,L]
RewriteRule ^style/font/.*?\.(eot|svg|ttf|woff)$ - [E=SAFE_RESOURCE:1]
Header set Access-Control-Allow-Origin * env=SAFE_RESOURCE
RewriteRule ^topsekritsim\.php$ / [R=301,L]
RewriteRule ^topsekrit3\.php$ / [R=301,L]
RewriteRule ^temporary508\.php$ / [R=301,L]
RewriteRule ^temporary508\.php$ / [R=301,L]
RewriteRule ^sim\.php$ / [R=301,L]
#RewriteRule ^([A-Za-z0-9-]*)$ closed.php [L,QSA]
RewriteRule ^$ - [E=INDEX_PAGE:1]
RewriteRule ^lobby/?$ / [R=301,L]
RewriteRule ^(teambuilder|ladder|battle)$ ./ [L,E=INDEX_PAGE:1]
RewriteRule ^(teambuilder|ladder|battle)/$ /$1 [R=301,L]
RewriteRule ^(lobby|battle)-([A-Za-z0-9-]*)$ ./ [L,E=INDEX_PAGE:1]
# Headers for the index page.
Header set Cache-Control "no-cache, no-store, must-revalidate" env=INDEX_PAGE
Header set Pragma "no-cache" env=INDEX_PAGE
Header set Expires "0" env=INDEX_PAGE
Header set X-Robots-Tag "noindex" env=INDEX_PAGE
# No direct linking to the lobby.
RewriteCond %{ENV:SCRIPT_URL} ^/(lobby/?)?$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|appjs)
RewriteCond %{REMOTE_ADDR} !^69\.85\.87\.173$
RewriteCond %{REMOTE_ADDR} !^173\.213\.97\.68$
RewriteCond %{REMOTE_ADDR} !^173\.252\.196\.254$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule ^.* http://www.pokemonshowdown.com/ [R=303,L]
RewriteRule ^replay/battle-([A-Za-z0-9-]+)$ http://www.pokemonshowdown.com/replay/$1 [R=302,L]
RewriteRule ^replay/turn_(.+)\.png$ replay/turn-image.php?data=$1 [L,QSA]
RewriteCond %{QUERY_STRING} !output=html
RewriteRule ^ladder\.php$ http://www.pokemonshowdown.com/ladder/ [R=301,L]
RewriteRule ^~~([^:/]*)(:[0-9]*)?/action\.php$ action.php?serverid=$1 [L,QSA]
RewriteRule ^~~([^:/]*)(/.*)?$ http://$1.psim.us$2 [R=301,L]
RewriteRule ^~~([^:/]*):([0-9]*)(/.*)?$ http://$1-$2.psim.us$3 [R=301,L]
RewriteRule ^backup/ - [F]
RewriteRule ^\.git/ - [F]
RewriteRule ^lib/ - [F]
RewriteRule ^githooks/ - [F]
RewriteRule ^\.gitignore$ - [F]
RewriteRule ^README\.md$ - [F]
RewriteRule ^index\.template\.html$ - [F]
RewriteRule ^testclient\.html$ - [F]
</IfModule>