Q:

htaccess redirect not changing the url in address bar

I have the following code in my htaccess:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^shop/[A-Z]{3,9}\ /products\.php\?levelID=([^&]+)&level=([^&]+)\ HTTP/
RewriteRule ^shop/products\.php$ http://foo.info/product/%1/%2.html [R=301,L]
RewriteRule ^product/([^/]*)/([^/]*)\.html$ /shop/products.php?levelID=$1&level=$2 [L]

this successfully rewrites the the dynamic URL internally to 
http://foo.info/product/9/Laser%20printers.html

but I want the link to change automatically in the BROWSER address bar to
http://foo.info/product/9/Laser%20printers.html

I guess rewrite condition should take care of it but not getting the correct one. Please help. 

A:

Try:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /shop/products\.php\?levelID=([^&]+)&level=([^&]+)\ HTTP/
RewriteRule ^shop/products\.php$ http://foo.info/product/%1/%2.html? [R=301,L]
RewriteRule ^product/([^/]*)/([^/]*)\.html$ /shop/products.php?levelID=$1&level=$2 [L]

The %{THE_REQUEST} variable is the first line of the HTTP request, which looks something like:
GET /shop/products.php?levelID=123 HTTP/1.1

When you added a /shop to the very front of that, it made it so that condition will never be met.

