I want to rewrite my apache mod_rewrite pattern. I use to do with following:
RewriteEngine on
RewriteRule /^([^A-Z0-9a-z]+)\.html /search.php?search_id=$1&%{QUERY_STRING}
With the above rule I can’t get what I expecting.
Can anyone tell what is wrong with my code and how to solve it.
Edited.
my requirement is simple.
I want to redirect if i enter /1.html to /search.php?search_id=1
Thats it.
This should work:
Maps silently
http://example.com/FileID.htmlTo:
http://example.com/search.php?search_id=FileIDsearch.phpis considered a fixed string, whileFileIDcan be any number.For permanent redirection, replace
[L,QSA]with[R=301,L,QSA]