Redirect if url include "xxx" word // How can I do? How can I redirect xxx including url of my sites to mysite.com main domain with .htaccass? Thanks.
Hi Horug, could you give us a little more details please. From what i get from what you have said, is anything with "xxx" in it should be redirected to / on your website ? if that's the case say so, otherwise can we get a little more info please.
Like this; example block word is "sex" abc.com/search.php?q=sex redirect -> abc.com abc.com/search.php?q=include+sex+search+words redirect -> abc.com abc.com/sex-xyz-123.html redirect -> abc.com abc.com/sex-xyz-123/ -> abc.com all links on our site include sex word redirect homepage. Thanks.
why would you want that? is it just the word sex? or a list of banned words? if its a list of banned words your better off using php to pull them from a DB if not use an apache rewrite RewriteRule ^sex$ abc.com [R=301]
Hi Monkeymafia, you'll find, that rule will only redirect /sex and will causing an issue you'ld want something like RewriteRule sex http://abc.com [R=301,L] Code (markup): that should do what you are asking
no worries - mod rewrite can be a large pain sometimes esp when you start geting into the regex stuff =)