gpt4 book ai didi

apache - 重定向 CSS 过多

转载 作者:行者123 更新时间:2023-12-02 18:48:21 26 4
gpt4 key购买 nike

我收到错误 style.css:1 GET https://www.example.com/cs_CZ净::ERR_TOO_MANY_REDIRECTS

可能与我的 htaccess 有关吗?

RewriteEngine On
AddDefaultCharset utf-8
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]

编辑:@RavinderSingh13 更改后,我遇到权限错误 enter image description here

最佳答案

通过以下方式获取您的 htaccess 文件,请确保在测试您的网址之前清除浏览器缓存。

RewriteEngine On
AddDefaultCharset utf-8
##Placing rules for non-https URLs here to apply https on URLs.
##Fixes: Added NE flag in rules here.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

##Placing rules for non www URLs here to apply www on URLs.
##Fixes: Added NE flag in rules here.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}/$1 [R=301,L,NE]

##Rules for files to block those urls.
##Fixes: Added L flag to the rules.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [F,L]
RewriteRule ^\.htaccess/?$ - [F]

##Removed condition RewriteCond %{REQUEST_URI} ="" here as its not required.
RewriteRule ^/?$ /public/index.php [L]

##Rules for non public uris to handle here.
RewriteCond %{REQUEST_URI} !^/public [NC]
RewriteRule ^(.*)/?$ /public/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(public)/.*$ /$1/index.php [QSA,NC,L]

关于apache - 重定向 CSS 过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67125384/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com