how to block redirects? (apache)

December 16, 2015 439 views
DNS Apache LAMP Stack DigitalOcean Security WordPress Ubuntu

There is a domain that is not my property, "", performing a redirect on my domain "vrwebsolutions". I saw through Whois pointing to my nameserver.

So if I go on "" I view the same content as ""

How do I block and avoid all this?



1 Answer

Hey Caren,

Here is a tutorial that talks about how to create a redirect.

You could place a .htaccessfile in the main web directory which is usually /var/ww/html/ by default. You would place the following lines in that file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)? digitalbellies\.com [NC]
RewriteRule (.*)    - [F]

If you're using Ubuntu, you'd want to also make sure that mod_rewrite is enabled by running a2enmod rewrite. If you did need to enable mod_rewrite, you would need to restart Apache for thta to take effect - service apache2 restart

Happy coding,

Jon Schwenn
Platform Support Specialist

by Justin Ellingwood
HTTP redirects are used to redirect web site visitors to new locations when they request content. These are useful for a variety of reasons, whether permanent or temporary. This guide will demonstrate how to redirect visitors using Apache and Nginx.
Have another answer? Share your knowledge.