Im trying to perform a mod rewriting to my web site. And I used to do this rewriting for quite some time. Of course I am very much upto the task until I met new requirement to create a rewritten URL with query strings after .html
Example – http://kypseli/admin/catagory.html?parent_id=1
I have used this this regex.
RewriteRule ^([A-Za-z0-9-/_]+).([html])/?$ index.php?rt=$1&%{QUERY_STRING}
But the query string value (parent_id) not passing.
This is working with out the .html part for perfection.
http://kypseli/admin/catagory/?parent_id=1
But I want it with .html part, as I have found lots and lots of same technique usage every where in WWW. here is one example
http://www.espncricinfo.com/ci/content/video_audio/559158.html?genre=46
Can someone please help.
If you want to get all query string elements from the first query to be appended on your rewritten query you need to add the
[QSA]flag to the rewriteRule, or[qsappend]if you prefer long and descriptive tags.Now I do not understand fully what you mean about ‘.html’, but I hope this will be enough.
EDIT
your problem is maybe the dot, it should be escaped
\.and it should be in the optionnal part if it is optionall so :Or if you want only one rule, this should work (untested)
And it’s unsure you really need the
?in your rewriteRule, you may want to apply it even without query strings.