I am trying to do a mod_rewrite redirect like this: RewriteRule ^products/([0-9][0-9])/$ /productinfo.php?prodID=$1 The redirect works, but the address bar shows http://www.blabla.com/productinfo.php?prodID=65 when I'd like it to show http://www.blabla.com/products/65 Is this normal, or am I doing something wrong?
mod_rewrite will take your pretty url and send it to your server as a query string (assuming it is configured properly). So, if you type in the url with the query string it will still be displayed with the query string. However, if you type in the pretty url it will display as such in the browser. This means you chould change all of the link in your site to use your pretty url and it should work just as you want.
If you pasted your exact .htacess rewriterule then yes, you are doing it wrong... it shouldn't redirect to your real address, it should stay the same as you typed it in your browser. I think you are missing [L] at the end of that line. So it should look like this: RewriteRule ^products/([0-9][0-9])/$ /productinfo.php?prodID=$1 [L] Code (markup): Oh and by the way... you do know that this rule "([0-9][0-9])" will work only for your products with ID from 10 up to 99 ? It will not match three digit numbers (or larger) and it will not match the products with ID number smaller then 10.