gpt4 book ai didi

apache - 为什么我会收到重定向循环?

转载 作者:可可西里 更新时间:2023-11-01 16:24:52 24 4
gpt4 key购买 nike

我有一个网站,例如 ( http://example.com )。我想要任何关于/的请求,即 http://example.com被重定向到 http://example.com/stuff .我添加了一个包含以下行的 .htaccess 文件:

redirect 301 / http://example.com/stuff

有什么建议吗?

最佳答案

参见 Redirect directive's documentation :

Then any request beginning with URL-Path will return a redirect request to the client at the location of the target URL. Additional path information beyond the matched URL-Path will be appended to the target URL.

改用RedirectMatch:

RedirectMatch 301 ^/$ http://example.com/stuff

关于apache - 为什么我会收到重定向循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1755800/

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