我有网站。在以前的主机上,我对.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>我哪里做错了?这就是我在Google Chrome中看到的

发布于 2019-04-22 18:38:20
尝尝这个。
RewriteEngine On
RewriteBase /
php_flag display_errors Off
RewriteCond %{HTTP_HOST} ^yzerkalo\.ru [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.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>https://stackoverflow.com/questions/55786645
复制相似问题