: If mod_rewrite is enabled on your server you may create following .htaccess file in the folder root_folder/xpto.com/: RewriteEngine on RewriteCond %{HTTP_HOST} mainsite.com$ [NC] RewriteRule .* -
If mod_rewrite is enabled on your server you may create following .htaccess file in the folder root_folder/xpto.com/:
RewriteEngine on
RewriteCond %{HTTP_HOST} mainsite.com$ [NC]
RewriteRule .* - [F]
This will check if the request URL ends with mainsite.com and deny access if it does.
EDIT: If you want to return a 404 Not Found, you may use this RewriteRule (first two lines stay the same):
RewriteRule .* - [R=404]
You can also insert other HTTP status codes instead of 404 (but replace the dash with an actual URL for redirects).
More posts by @Gloria169
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.