I'm trying to make a friendly URL through RewriteRule
but it keeps ignoring #
as part of the variable value.
The line on .htaccess is as simple as this
RewriteRule ^key/(.+)/$ index.php?key=$1
and the requested URL is
http://www.example.com/key/c%23/
but I'm only getting c
as get variable and not c%23
.
What exactly am I doing wrong?
Finally after some digging, I managed to pull this off.
It just needs the B
flag on RewriteRule to escape non-alphanumeric characters such as #
RewriteRule ^key/(.+)/$ index.php?key=$1 [B]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With