CarenZ
By:
CarenZ

how to block redirects? (apache)

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

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

So if I go on "digitalbellies.com" I view the same content as "vrwebsolutions.com"

How do I block and avoid all this?

regards,

CarenZ.

2 Answers

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
DigitalOcean

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.

Your website has been clickjacked by another user. To make sure your website is click jacked open the website in google chrome and press F12 to open developer tools and you could iframe enabled for your website. Add the below apache config .

Header always append X-Frame-Options DENY

Have another answer? Share your knowledge.