想知道是否有人能帮我。我试图删除302重定向从我的一个网站,但我不能得到正确的代码。它适用于第一个http -> https,但重定向到/tt-rss/的操作仍在使用302进行。
这就是我的using......can,有人帮我吗?
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]>>> http://rss.oliroe.com
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status: 301 Moved Permanently
Code: 301
Server: nginx
Date: Wed, 05 Oct 2022 12:14:02 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 231
Connection: close
Location: https://rss.oliroe.com/
>>> https://rss.oliroe.com/
> --------------------------------------------
> 302 Found
> --------------------------------------------
Status: 302 Found
Code: 302
Server: nginx
Date: Wed, 05 Oct 2022 12:14:03 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
X-Powered-By: PHP/8.1.11
Location: /tt-rss/
Strict-Transport-Security: max-age=15768000; includeSubdomains; preload
>>> /tt-rss/
> --------------------------------------------
> 200 OK
> --------------------------------------------
Status: 200 OK
Code: 200
Server: nginx
Date: Wed, 05 Oct 2022 12:14:03 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
X-Powered-By: PHP/8.1.11
Cache-Control: public
Strict-Transport-Security: max-age=15768000; includeSubdomains; preload发布于 2022-10-05 20:59:20
我已经解决了这个问题,网站在index.php头(“Location:/tt/”)中有这段代码;我没有意识到在php中重定向默认为302。将行更改为标头(“Location:/true/”,true,301);解决了我的问题。非常感谢
https://stackoverflow.com/questions/73960276
复制相似问题