1

A client of mine has found out today that someone has set up a spoof domain (1 letter different - design instead of designs) and has tried to set up credit accounts in his name.

The domain will undoubtedly be removed, but is it possible in the meantime using some htaccess trick to check if a visitor to www.designs.com has been referred from www.design.com and if they have, send them to a warning page?

BN83
  • 902
  • 3
  • 9
  • 29
  • Possible duplicate of [Redirect using htaccess based on referrer](http://stackoverflow.com/questions/13106299/redirect-using-htaccess-based-on-referrer) – Alex Howansky Jan 19 '16 at 19:05

1 Answers1

0

You can use this code in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http(s)?://([^\.]+\.)?design\.com
RewriteRule ^.* /warning.html [L,R=302]

It will redirect any pages coming from design.com and its possible subdomains (using http or https) to a page named warning.html at the root of your project.

You can test this rule with this online tool.

Florian Lemaitre
  • 5,905
  • 2
  • 21
  • 44