Ticket #4773 (closed defect (bug): fixed)
Canonical URL addition causes redirection problems
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.3 |
| Component: | General | Version: | 2.3 |
| Severity: | critical | Keywords: | |
| 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
Change History
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.
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.
comment:4
markjaquith — 4 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/
comment:5
markjaquith — 4 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
Post preview links are redirected.
From: http://foo.bar/?p=1501&preview=true To: http://foo.bar/?p=1501?p=1501
| 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.
comment:10
Nazgul — 4 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.
comment:11
rejon — 4 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.
comment:12
westi — 4 years ago
See also #4862 possibly related
comment:13
markjaquith — 4 years ago
comment:14
follow-up:
↓ 15
markjaquith — 4 years ago
comment:15
in reply to:
↑ 14
jbctech — 4 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...
comment:16
ryan — 4 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. :-)
comment:17
matt — 4 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.
comment:18
wantmoore — 4 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.
comment:20
follow-ups:
↓ 21
↓ 24
markjaquith — 4 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"
comment:21
in reply to:
↑ 20
wantmoore — 4 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
comment:22
follow-up:
↓ 23
markjaquith — 4 years ago
Where is your site?
comment:23
in reply to:
↑ 22
wantmoore — 4 years ago
The development site is at http://mindstormweb.com/kellyhastings
comment:24
in reply to:
↑ 20
wantmoore — 4 years ago
I've svn up'd this morning and am still having the issue.
comment:25
markjaquith — 4 years ago
wantmoore,
Thanks so much for the report. I was able to reproduce the issue, and develop a fix.
comment:26
markjaquith — 4 years ago
- Status changed from assigned to closed
- Resolution set to fixed
comment:27
jbctech — 4 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
This is still broken at revision 6089
comment:28
jbctech — 4 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.
comment:29
markjaquith — 4 years ago
- Status changed from reopened to closed
- Resolution set to fixed
comment:30
Funbug — 4 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
Post preview will redirect infinitely on two of my blogs until I add
|| is_preview()
at line 7 of canonical.php
comment:31
Viper007Bond — 4 years ago
You should probably make a new ticket for this rather than reopening this one.
comment:32
Funbug — 4 years ago
- Status changed from reopened to closed
- Resolution set to fixed
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