Hey Fellow Programmers!
Ok real trivial I am sure but I just can't work this out.
Basically (when not logged in) and requesting a page without a trailing slash the browser returns
"redirect loop"
error or in Firefox an alternative error but similar.
Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies.
Interestingly... When you do a simple refresh it loads fine and then it caches the 301 so works after.
Ok so here are the response headers:
http://www.theurl.com/attitude-competition
HTTP/1.1 301 Moved Permanently Date: Mon, 28 Oct 2013 23:05:28 GMT Server: Apache/2.2.14 (Ubuntu) X-Powered-By: PHP/5.3.2-1ubuntu4.20 X-Pingback: http://www.theurl.com/xmlrpc.php Location: http://www.theurl.com/attitude-competition/ Vary: Accept-Encoding Content-Length: 0 Content-Type: text/html; charset=UTF-8
http://www.theurl.com/attitude-competition/
HTTP/1.1 200 OK Date: Mon, 28 Oct 2013 23:05:30 GMT Server: Apache/2.2.14 (Ubuntu) X-Powered-By: PHP/5.3.2-1ubuntu4.20 X-Pingback: http://www.theurl.com/xmlrpc.php Link: ; rel=shortlink Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8
Everything looks OK to me, but I've tested in different browsers and it just fails each time.
EDIT
I have done some further research and here are the headers when logged in as admin which doesn't have the same issue.
HTTP/1.1 301 Moved Permanently Date: Tue, 29 Oct 2013 00:03:20 GMT Server: Apache/2.2.14 (Ubuntu) X-Powered-By: PHP/5.3.2-1ubuntu4.20 X-Pingback: http://www.theurl.com/xmlrpc.php Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Location: http://www.theurl.com/attitude-competition/ Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 20 Keep-Alive: timeout=15 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8
EDIT 2
Also even more oddly when Chromes Web Inspector is open it works fine. Can't be cache as I've tried incognito and other browsers.
Any ideas at all?
I would check that you haven't got any conflicting rules with your server (such as .htaccess or nginx rules) where basically one is trying to correct the other and thus the infinite loop.
I'd also make sure your rewrite rules are OK - have you done anything funky with permalinks? Quick way to debug would be turn off permalinks or change the rule to a different one. May give some clues