Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Let's say I have the sites and They are hosted such that actually points to

How can I block someone from visiting using mod_rewrite?

So far I've tried this to no avail (in root of

RedirectMatch 301 ^/siteB/$
share|improve this question

migrated from Mar 6 '11 at 2:26

This question came from our site for system and network administrators.

1 Answer 1

up vote 1 down vote accepted

Try something like

# you may need to drop the leading slash if you're doing this in .htaccess   
RewriteCond %{HTTP_HOST} !^siteB\.com$
RewriteRule ^/siteB [R=301]
share|improve this answer
Thank you very much! – Chris Laplante Mar 7 '11 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.