From 99501a43d73820ff4ef8ebcdb7efe91bf405fb65 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Wed, 25 Oct 2023 16:34:22 +0000 Subject: [PATCH] Allow direct-linking lobby In the distant past, Lobby was open by default, so people linking to Lobby usually meant to link to PS itself, so links to Lobby would just open PS. This is no longer necessary, now that we no longer open Lobby by default. This commit also cleans up a bunch of other .htaccess entries, for style/readability. --- .htaccess | 22 +++++++++++----------- website/.htaccess | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.htaccess b/.htaccess index 6852f5435d7..f886e0eaa45 100644 --- a/.htaccess +++ b/.htaccess @@ -21,7 +21,7 @@ RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] RewriteCond %{QUERY_STRING} !^insecure [NC] RewriteRule ^([A-Za-z0-9-]*)$ https://play.pokemonshowdown.com/$1 [R=307,NE,L] -# basic stuff +# redirects RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] RewriteRule ^appeals?\/?$ https://play.pokemonshowdown.com/view-help-request--appeal [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] @@ -121,16 +121,16 @@ Header set Pragma "no-cache" env=INDEX_PAGE Header set Expires "0" 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 %{HTTP_HOST} ^play\.pokemonshowdown\.com$ -RewriteCond %{REMOTE_ADDR} !=127.0.0.1 -RewriteCond %{REMOTE_ADDR} !=162.243.13.96 -RewriteCond %{HTTP:CF-Connecting-IP} !=173.252.196.254 -RewriteCond %{HTTP:CF-Connecting-IP} !=198.27.67.31 -RewriteCond %{HTTP:CF-Connecting-IP} !=162.243.13.96 -RewriteRule ^.* https://pokemonshowdown.com/ [R=303,L] +# RewriteCond %{ENV:SCRIPT_URL} ^/(lobby/?)?$ +# RewriteCond %{HTTP_REFERER} !^$ +# RewriteCond %{HTTP_REFERER} !^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|# appjs) +# RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ +# RewriteCond %{REMOTE_ADDR} !=127.0.0.1 +# RewriteCond %{REMOTE_ADDR} !=162.243.13.96 +# RewriteCond %{HTTP:CF-Connecting-IP} !=173.252.196.254 +# RewriteCond %{HTTP:CF-Connecting-IP} !=198.27.67.31 +# RewriteCond %{HTTP:CF-Connecting-IP} !=162.243.13.96 +# RewriteRule ^.* https://pokemonshowdown.com/ [R=303,L] AddType 'text/plain; charset=UTF-8' json5 diff --git a/website/.htaccess b/website/.htaccess index 1b7ecc215f4..96aaf8ed75b 100644 --- a/website/.htaccess +++ b/website/.htaccess @@ -11,9 +11,9 @@ allow from all order deny,allow deny from all -#AuthName pokemonshowdown.com -#AuthUserFile /home/pokemon/public_html/_vti_pvt/service.pwd -#AuthGroupFile /home/pokemon/public_html/_vti_pvt/service.grp +# AuthName pokemonshowdown.com +# AuthUserFile /home/pokemon/public_html/_vti_pvt/service.pwd +# AuthGroupFile /home/pokemon/public_html/_vti_pvt/service.grp AddType text/plain .phps AddType application/octet-stream .heapsnapshot @@ -35,7 +35,7 @@ RewriteRule ^(.*)$ https://pokemonshowdown.com/$1 [R=302,NE,L] RewriteCond %{HTTP_HOST} ^(www\.)?forum\.pokemonshowdown\.com$ [NC] RewriteRule ^(.*)$ https://pokemonshowdown.com/forums/ [R=301,NE,L] -RewriteCond %{HTTP_HOST} !^pokemonshowdown\.com$ +RewriteCond %{HTTP_HOST} ^www\.pokemonshowdown\.com$ RewriteRule ^(.*)$ https://pokemonshowdown.com/$1 [R=301,NE,L] RewriteRule ^secure$ ./ [L,QSA]