My PHP file looks for a URL parameter id
such that the URL looks like this:
www.example.com/player.php?id=player_name
where player_name is the id. I cleaned up the URLs using .htaccess so the URL looks as such:
www.example.com/Player/player_name/
and that has been fine except for in the case that I pass in a player ID such as #octothorpe (encoded as %23octothorpe). For some reason, this is still read as a fragment in the URL and ignored by the server, so when the PHP file looks for id
, it can't find it. The interesting part is that if I use the ugly URL
www.example.com/player.php?id=%23octothorpe
its works completely fine, but when I do
www.example.com/Player/%23octothorpe
It can't find id
The relevant part of the .htaccess file looks as such:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^Player/(.*)/$ player.php?id=$1
RewriteRule ^Player/(.*)$ player.php?id=$1