Forum Moderators: phranque
RewriteCond %{QUERY_STRING} ^id=3$
RewriteRule ^materials/detail\.php$ /super-shop/bigstuff/siding.php? [R=301,L]
And:
RewriteBase /materials
RewriteCond %{QUERY_STRING} ^id=3$
RewriteRule ^detail\.php$ /super-shop/bigstuff/siding.php? [R=301,L]
These do not work. For one, they start passing the query string along to the "new" URL, even though I did not remove the ending "?" (from what I've read, it's the "?" that prevents the query string from getting passed along to the new URL). Also, they cause /materials to get prepended to the NEW URL and bigstuff/siding.php to be REMOVED from the new URL so that instead of:
www.site.com/super-shop/bigstuff/siding.php
it tries to hit:
www.site.com/materials/super-shop/?id=3
Again, the complete original URL is like this:
www.site.com/materials/detail.php?id=3&catid=2
And I need to direct them to, for example:
www.site.com/super-shop/bigstuff/siding.php
Then I'll need to make other, additional pairs, like this:
www.site.com/materials/detail.php?id=1&catid=6
www.site.com/super-shop/otherbigstuff/roof.php
Always try to understand what a particular ruleset really does before you use it. This avoids many problems.
I see that I got carried away obfuscating my example URLs (in case you're curious why I'm doing it at all - I'm testing on a dev site and I don't want there to be even the smallest possibility that a search engine will find the dev URL, or the keywords in the subpath).
"Safari can’t open the page.
Too many redirects occurred trying to open “http://www.site.com/materials/super-shop/?id=3”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page."
I don't get any errors in the apache logs.
Does mod_rewrite get cached in any way?
[A-Z]+\ with [A-Z]{3,9}\