Hai
I have one more doubt in apache mod_rewrite. I want to rewrite the url mydomain/index.php?category=1&id=1 To mydomain/index/category/1/id/1 How I write rule in .htaccess
And what is the link that i have to give inside the a tag
Please give me a solution..
Not tested, but worth a shot:
Your URLs can look exactly like the way you mentioned:
Inside the
<a>
tags you will use the nice link, that iscategory/1/id/1
(that's exactly why you're usingmod_rewrite
, to be able to use nice URLs!)As for the rule, try something like (untested):
Actually I would rather use
So you can call directly
mydomain/1/1
but you got the idea I hopeEDIT: the
&%{QUERY_STRING}
part is not necessary for what you asked, but I generally include it in case I want to pass any extra parameter to the page.