1
votes

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.

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]

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.

1
Try clearing the browser-cache first. Apache redirect are not browser-specific.Gerben
Done ... a million times over.WH Web Dev
This problem is happening on new.whitehardt.com if you navigate to any of the internal pages and remove the trialing slash from the URL and then try to navigate to the page it will cause a recursive redirect 99% of the time in Firefox. In chrome it does not happen for me but the other developer here does have it happening in chrome. Please someone provide some insight into this as we are pulling our hair out trying to fix it.WH Web Dev
I see it happen in firefox and chrome (also Canary). The 301's have a 'powered by php' header, so it's not apache that is doing this. See below for a fix.Gerben

1 Answers

0
votes

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.

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]