I’m doing what I thought was a simple .htaccess rewrite to create nicer urls. I want a url like this:
http://my-site.com/design/design-name/
to replace urls like this:
http://my-site.com/store?design=design-name
so I added this rule to my .htaccess:
RewriteEngine On
RewriteRule ^design/(.+) http://my-site.com/store?design=$1 [L]
However, it is behaving as if there is an R flag and externally redirecting (changing the url in the browser’s address bar). The redirection works fine, but shouldn’t it be only internally redirecting with the rule I’m using?
Ansari is correct. As mentioned here, including a domain name in the target URL turns it into a 302 redirect. Change
to
and it should work correctly.