i need to transform following address of my site: http://mysite.com/do.php?id=123.W456/789
into http://mysite.com/123.W456/789
i've almost got succeed in this noble purpose with following .htaccess file
DirectoryIndex mysite.php
RewriteEngine On
RewriteRule ^([A-Za-z0-9\/.]+)?$ mysite.php?id=$1 [L]
where .
is a code of .
(dot) character
it goes cool with such url string http://mysite.com/123W456/789
(i.e rewrites it to http://mysite.com/do.php?id=123W456/789
)
but DOESN'T rewrite url string with dot character - http://mysite.com/123.W456/789
can anybody help?
We use \.
to escape the dot character in an htaccess file, not the HTML entity for it. Using the HTML entity would make it think that you are allowing the &
, #
, and ;
characters rather than the .
character.
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