: How to block access to a sub-site with mod_rewrite? Let's say I have the sites siteA.com and siteB.com. They are hosted such that siteB.com actually points to siteA.com/siteB. How can I block
Let's say I have the sites siteA.com and siteB.com. They are hosted such that siteB.com actually points to siteA.com/siteB.
How can I block someone from visiting siteA.com/siteB using mod_rewrite?
So far I've tried this to no avail (in root of siteA.com):
RedirectMatch 301 ^/siteB/$ someothersite.com/
More posts by @Merenda212
1 Comments
Sorted by latest first Latest Oldest Best
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 siteB.com/ [R=301]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.