Im trying to redirect a bunch of support files to a different support system except for any files that have the folder software_updates in them. the following is the rule that I wrote.
RewriteRule ^/support/.*(?!software_updates).*$ newurl_location [NC,L,R=301]
this excludes /support/software_updates/ but not /support/product/software_updates Im trying to exclude any URL that has software_updates anywhere in the URL after support.
Try:
RewriteRule ^/support/(?!.*software_updates) newurl_location [NC,L,R=301] I don't have Apache handy to test it, but it should work.
rocketdoctor, I have tested this and believe that it is what you're looking for (please note the changes in the / and the .* )
RewriteRule ^support/(?!.*?software_updates) newurl_location [NC,L,R=301] You were nearly there.
First off, you don't need the initial /
You don't want .*(?!software_updates).*, because this will match software_updates. Why? The dot-star eats the whole string, then, at the end, you have the assertion that software_updates is not next. And of course this is true.
This should do the trick.
RewriteRule ^/support/(?!.*software_updates).*$ newurl_location [NC,L,R=301] See Demo
No comments:
Post a Comment