diff --git a/.htaccess b/.htaccess index 173fe3706..8b97ccc0f 100644 --- a/.htaccess +++ b/.htaccess @@ -20,13 +20,9 @@ AddType application/x-web-app-manifest+json .webapp 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] diff --git a/index.php.template.txt b/index.php.template.txt index d431e3a7f..6c5dc3b02 100644 --- a/index.php.template.txt +++ b/index.php.template.txt @@ -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();