psim.us configuration changes

This commit is contained in:
Cathy J. Fitzpatrick
2013-04-15 21:05:15 -06:00
parent f872ebda0a
commit bf3f2c81fe
2 changed files with 2 additions and 6 deletions

View File

@@ -20,13 +20,9 @@ AddType application/x-web-app-manifest+json .webapp
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.play\.pokemonshowdown\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?psim\.us$ [NC]
RewriteCond %{HTTP_HOST} ^www\.play\.pokemonshowdown\.com$ [NC]
RewriteRule ^(.*) http://play.pokemonshowdown.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(.*?)-8000\.psim\.us$ [NC]
RewriteRule ^(.*) http://%1.psim.us/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^play\.pokemonshowdown\.com$ [NC]
RewriteRule ^sprites/(.*)$ http://play.pokemonshowdown.com/sprites/$1 [R=301,L]

View File

@@ -2,7 +2,7 @@
// no direct linking to the lobby
if ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/lobby') {
if (!empty($_SERVER['HTTP_REFERER']) && !preg_match('/^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|appjs)/', $_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_HOST'] === 'play.pokemonshowdown.com') {
if (!empty($_SERVER['HTTP_REFERER']) && !preg_match('/^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|appjs)/', $_SERVER['HTTP_REFERER']) && $_SERVER['REMOTE_ADDR'] !== '69.85.87.173') {
header('HTTP/1.1 303 See Other');
header('Location: http://pokemonshowdown.com/');
die();