Deny https from search engines indexing

Well, if you have such problem, let’s do the following:

  1. Create two files:
    1. robots.txt:
      User-agent: *
      Allow: /
    2. robots-https.txt:
      User-agent: *
      Disallow: /
  2. Now write in your .htaccess this:
    RewriteEngine on
    RewriteCond %{HTTPS} on
    RewriteRule ^robots\.txt$ robots-https.txt

That’s all :) Have a nice day.


Tags: , , , , , , ,