: Edit: Fixed an error! This is the theory: RewriteEngine on RewriteCond %{HTTP_HOST} mom.com$ [NC] RewriteRule ^mom/ - [R=404,L] On some versions, if the above doesn't work, you can do this ugly
Edit: Fixed an error!
This is the theory:
RewriteEngine on
RewriteCond %{HTTP_HOST} mom.com$ [NC]
RewriteRule ^mom/ - [R=404,L]
On some versions, if the above doesn't work, you can do this ugly trick
RewriteEngine on
RewriteCond %{HTTP_HOST} mom.com$ [NC]
RewriteRule ^mom/ /someurlthatdoesntexist [L]
If you're fine with a 403 forbidden instead of a 404 not fund, you can use the F option.
RewriteEngine on
RewriteCond %{HTTP_HOST} mom.com$ [NC]
RewriteRule ^mom/ - [F,L]
However, there's one more thing to consider. .htaccess files are scanned from the top level and down, so if mom.com has any .htaccess files, they will take precedence. What you can do then, is the add the following to the .htaccess files in mom.com. This should be at the top of the files (right after RewriteEngine On).
RewriteEngine on
RewriteCond %{HTTP_HOST} !mom.com$ [NC]
RewriteRule . - [R=404,L]
Note the added !, which means match if the domain is not mom.com. Also note the . which means "catch all".
Replace - [R=404,L] with any of the other patterns as needed.
More posts by @Gail5422790
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.