Answer the question
In order to leave comments, you need to log in
Why is the robots.txt file accessible via http and https when redirected to https?
The site for fsekh files has a redirect from http to https. Everything works correctly, but for some reason robots.txt is available via both protocols, but I need everything to be via https.
.htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index.html$ [NC]
RewriteRule .+ https://zaoks.ru/ [R=301,L]
#RewriteCond %{ENV:HTTPS} !on
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
DirectorySlash Off
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} "^\S+ /([^?.]+)\.html"
RewriteRule ^(?:index|([^.]+))\.html$ https://zaoks.ru/$1 [R=301,L]
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://zaoks.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} ![^\/]$
RewriteRule ^(.*)\/$ https://zaoks.ru/$1 [R=301,L]
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^([^.]+)$ /$1.html [L]
ErrorDocument 404 /404.html
#RewriteRule ^index\.html$ / [NC,R,L]
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question