: Modify existing htaccess rewrites to not match particular URLs Trying to rewrite only particular URL's, for example:- (1) I want to rewrite:- http://www.example.com/keyword-1 http://www.example.com/keyword-1/sub-keyword
Trying to rewrite only particular URL's, for example:-
(1) I want to rewrite:-
www.example.com/keyword-1 http://www.example.com/keyword-1/sub-keyword www.example.com/keyword-1/?p=50
(2) I don't want to rewrite:-
www.example.com/keyword-1-product
This is what I have so far...
RewriteRule ^/?alfred-victoria$ /brands/alfred-victoria/ [R=301,L]
RewriteRule ^/?alfred-victoria/(.*)$ /brands/alfred-victoria/ [R=301,L]
These handle (1) above but not (2), URL's that start with the keyword in /alfred-victoria-blah-blah are also getting rewritten.
How can I modify the rules above to exclude these URL's. I thought the dollar ($) indicated end of string and ignore anything else after this point?
More posts by @Angela700
1 Comments
Sorted by latest first Latest Oldest Best
As you suggest, neither of those two rules can be redirecting /alfred-victoria-blah-blah. So, either there is something else that is performing this redirect, or a previous (erroneous) 301 redirect has been cached - clear the browser cache etc.
Also, confirm whether this is a 301 redirect and not a 302 or some other 3xx (could help indicate where this is happening).
It would seem that an old redirect was cached on this occasion.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.