【发布时间】:2019-09-11 04:31:37
【问题描述】:
我有网站。在以前的主机上,.htaccess 文件没有任何问题。
现在我对TOO_MANY_REDIRECTS 有一些问题。
我需要将所有请求从yzerkalo.ru 或www.yzerkalo.ru 重定向到https://**
我有这个.htaccess 文件:
RewriteEngine On
RewriteBase /
php_flag display_errors Off
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{HTTP_HOST} ^www.yzerkalo\.ru$ [NC]
RewriteRule ^(.*)$ https://yzerkalo.ru/$1 [R=301,L]
RewriteRule ^sitemap\.xml$ sitemap.xml [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*$ index.php [L]
# One month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2628000, public"
</filesMatch>
【问题讨论】:
-
@Emma 不,没用(
-
@Emma 你是什么意思?
-
@KoenHollander Emma 之前使用此链接
-
为什么这段代码可以在
zerkalo3x.ru上工作,但在这里不能工作?? -
@Emma 我正在添加慢速 3g 的图像加载