字preSS递归重定向问题递归、重定向、问题、preSS

2023-09-02 00:59:49 作者:装淑女、姐不会

我们有与递归重定向问题。到目前为止,我们只注意到这种情况发生在Safari浏览器,移动Safari和Firefox。它似乎永远不会发生在Chrome浏览器。

We are having issues with recursive redirects. So far we have only noticed this happening in Safari, Mobile Safari, and Firefox. It never seems to happen in Chrome.

起初,问题似乎只发生时,我们就省略了结尾的斜线,但现在它有或没有结尾的斜线发生,有时它甚至我​​们重定向到不同的网页完全。

At first the problem only seemed to happen when we would omit the trailing slash, but now it happens with or without the trailing slash and occasionally it even redirects us to a different page entirely.

.htaccess文件如下。这仅仅是默认的.htaccess时pretty的永久链接都是活动的。

the .htaccess file is below. It is just the default .htaccess when pretty permalinks are active.


    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

我不能提供此时的网站或网页的链接给我们的错误,因为它有它的敏感信息。我将尝试创建一个网页,复制错误,但没有时间现在。请任何帮助将大大AP preciated。我们不知道这是一个服务器的配置问题,htaccess的,或一些在Word preSS。

I can not provide a link at this time to the site or page giving us the error as it has sensitive information on it. I will attempt to create a page that duplicates the error but do not have time right now. Please any help would be greatly appreciated. we are not sure if this is a server configuration issue, htaccess, or something in WordPress.

我们没有有效的插件,并尝试切换主题,以默认的,但问题仍然存在。

We have no active plugins and have tried switching the theme to the default one, but the problem persists.

推荐答案

不知道这是否有助于不过,因为有些事情似乎是第一个重定向是正确的,并增加了斜线是严重错误的,但随后的重定向,重定向到同一网址。此外,我可以看到在请求中有什么不同301后,或通过将URL中的地址的请求吧我自己。

Not sure if this helps though, as something seems to be seriously wrong as the first redirect is correct and adds the slash, but subsequent redirects, redirect to the same urls. Also I can see any different in the request after a 301, or a request by putting the url in the address bar myself.

以上的解决方案的修复程序是尝试和随时添加使用htaccess的斜线自己。

More of a fix than a solution is to try and always add the slash yourself using htaccess.

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $0 !/$
RewriteRule .* $0/ [R,L]

RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]