Skip to content

Commit

Permalink
Allow direct-linking lobby
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AnnikaCodes committed Oct 25, 2023
1 parent d67ff68 commit 99501a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions website/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ allow from all
order deny,allow
deny from all
</Limit>
#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
Expand All @@ -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]
Expand Down

0 comments on commit 99501a4

Please sign in to comment.