Disallow Robots to Crawling My Website after Redirecting it Https from Http using .htaccess

by Lekhraj Sharma   Last Updated October 15, 2018 06:04 AM

I have tried to disallow robots to crawling my website by adding robot.txt and redirecting website to https as Explained below

.htacces Contains the following code:-

RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

And robots.txt contains following code:-

User-agent: *
Disallow: /

Any help would be much appreciated. Thanks



Related Questions


Updated April 07, 2016 08:01 AM

Updated June 02, 2015 00:01 AM

Updated October 14, 2016 09:01 AM

Updated August 09, 2015 17:01 PM

Updated February 05, 2019 09:04 AM