Opened 17 years ago
Closed 17 years ago
#4773 closed defect (bug) (fixed)
Canonical URL addition causes redirection problems
Reported by: | jbctech | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 2.3 | Priority: | high |
Severity: | critical | Version: | 2.3 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
The addition of the canonical redirection in changeset 5890 and 5891 in SVN causes my site to display the following error message in Firefox:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
In Safari, it displays:
Safari can’t open the page.
Too many redirects occurred trying to open “http://www.MySite.com/”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.
I am able to access /wp-admin, and tried changing themes and/or settings with no success. Once I revert back to 5889, it works fine.
Attachments (1)
Change History (33)
#2
@
17 years ago
D,
Sorry - here's a bit more information:
Apache 1.3.37 (Unix)
I believe it's all standard rewrite options - the permalink Structure is "Date and name based" and the only other plugin that modifies the .htaccess file is FAlbum.
#3
@
17 years ago
I get this too.
Here is the information I see in the access log if it helps:
- - [22/Aug/2007:14:08:06 -0400] "GET /wp-admin/upgrade.php HTTP/1.1" 200 821 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2) Gecko/20070224 BonEcho/2.0.0.2"
- - [22/Aug/2007:14:08:06 -0400] "GET /wp-admin/css/install.css?version=2.3-alpha HTTP/1.1" 200 613 "http://xxx.net/wp-admin/upgrade.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2) Gecko/20070224 BonEcho/2.0.0.2"
- - [22/Aug/2007:14:08:07 -0400] "GET /wp-admin/images/wordpress-logo.png HTTP/1.1" 200 2345 "http://xxx.net/wp-admin/upgrade.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2) Gecko/20070224 BonEcho/2.0.0.2"
- - [22/Aug/2007:14:08:08 -0400] "GET /wp-admin/upgrade.php?step=1&backto= HTTP/1.1" 200 751 "http://xxx.net/wp-admin/upgrade.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2) Gecko/20070224 BonEcho/2.0.0.2"
- - [22/Aug/2007:14:08:10 -0400] "GET / HTTP/1.1" 301 5 "http://xxx.net/wp-admin/upgrade.php?step=1&backto=" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2) Gecko/20070224 BonEcho/2.0.0.2"
and from there it stays at 301
The only cure was the first permalink option. Anything else causes the browser loop.
At revision 5916.
Tested in Camino too.
#4
@
17 years ago
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
I'll need the URL of the blog. The best way to diagnose problems here is using the LiveHTTPHeaders Firefox add-on.
Mark, for your problem I'll disable the canonical functionality in /wp-admin/
#6
@
17 years ago
/wp-admin is fine, no problem.
The actual blog gets the message.
Contact me if you want backend access to the blog or ssh
#7
@
17 years ago
Post preview links are redirected.
From: http://foo.bar/?p=1501&preview=true To: http://foo.bar/?p=1501?p=1501
#8
@
17 years ago
is_admin() or without that in canonical.php |
I guess I'm the only one though so all I can do is revert to 2.2
Tried with the beta-1
I didn't mention there are no plugins and post preview does work albeit as Ryan describes.
#10
@
17 years ago
I'm able to reproduce this.
On my blog, if I surf to http://localhost/blogsvn/, at the end of the redirect_canonical function 'http://localhost/blogsvn/'==$redirect_url
and 'http://localhost/blogsvn/index.php'==$requested_url
, thus forcing a redirect and going into an infinite loop.
For some reason, the $requested_url gets a bonus index.php from somewhere that's causing this issue.
#11
@
17 years ago
- Severity changed from major to critical
Yes, I get the same thing on overlap.org which is running the latest from SVN. The paging is broken on categories.
#15
in reply to:
↑ 14
@
17 years ago
Replying to markjaquith:
(In [5978]) More cautious canonical-ness. Exclude IIS and POSTs. Better paging handling. Still a work in progress! see #4773
Is there a way to disable this 'canonical-ness'? I'm still having this problem with the latest svn...
#16
@
17 years ago
For now, you can comment out the last line in wp-includes/canonical.php. Of course, we'd appreciate it if you could try new versions as we release them so we can get it fixed for good. :-)
#17
@
17 years ago
Yes please don't disable without helping us identify the problem first, or it'll be broken for thousands of other people after the release.
#18
@
17 years ago
- Cc wantmoore@… added
I believe this may also be causing me some trouble on a site I've been developing recently. Site works fine until I enable the Front page/Posts page on the Options->Reading in the admin.
Info:
WP Trunk r6065
PHP 4.4.4
MySQL 4.1.22
Apache 1.3.37
Current rewriting being handled by WP via index.php - no .htaccess.
#20
follow-ups:
↓ 21
↓ 24
@
17 years ago
wantmore,
What are your symptoms?
Also, see if this fixed it: [6068] -- it's not related to Canonical URLs, but it is related to PATHINFO URLs and "show page on front page"
#21
in reply to:
↑ 20
@
17 years ago
Replying to markjaquith:
wantmore,
What are your symptoms?
Also, see if this fixed it: [6068] -- it's not related to Canonical URLs, but it is related to PATHINFO URLs and "show page on front page"
I just updated to r6070 and am still having the infinite redirect problem. With Firefox I get:
The page isn't redirecting properly 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.
It works exactly as expected when I comment out the add_action line in wp-includes/canonical.php
#23
in reply to:
↑ 22
@
17 years ago
The development site is at http://mindstormweb.com/kellyhastings
#25
@
17 years ago
wantmoore,
Thanks so much for the report. I was able to reproduce the issue, and develop a fix.
#27
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This is still broken at revision 6089
#28
@
17 years ago
I found the problem. For my site, the Blog Address (URL) in WordPress Options was http://www.MySite.com, however the canonical redirection was redirecting to http://www.mysite.com. The routine that protects against chained redirects did not handle the difference in case.
I have included the diff of what I did to get mine working... you may want to do it here, or you may want to just force it lower in the options menu.
#30
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Post preview will redirect infinitely on two of my blogs until I add
|| is_preview()
at line 7 of canonical.php
#32
@
17 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Okay, sorry. I just wasn't sure -> http://trac.wordpress.org/ticket/5203
Can you perhaps give some more information?
Are you using Apache? IIS?(What rewrite modules?)
What permalink structure? (Are you using any non-default Mod Rewrite options?)
I've not looked too closely at the code(Yet) but thats just general questions(But we need more info to track down the actual exact problem).
D