mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-05-31 21:22:20 -05:00
61 lines
2.1 KiB
ApacheConf
61 lines
2.1 KiB
ApacheConf
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
|
|
|
|
RewriteCond %{HTTP_HOST} ^www\.play\.pokemonshowdown\.com$ [NC]
|
|
RewriteRule ^(.*) http://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 ^$ - [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} !^127\.0\.0\.1$
|
|
RewriteRule ^.* http://pokemonshowdown.com/ [R=303,L]
|
|
|
|
RewriteRule ^replay/battle-([A-Za-z0-9-]+)$ http://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://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>
|