[wp-trac] [WordPress Trac] #17114: Blog URLs need canonical redirect functionality similar to post URLs
WordPress Trac
wp-trac at lists.automattic.com
Tue Apr 12 06:29:30 UTC 2011
#17114: Blog URLs need canonical redirect functionality similar to post URLs
--------------------------+-----------------------------
Reporter: amattie | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
Take a look at these two URLs:
http://www.nileguide.com/destination/blog/amsterdam/
http://www.nileguide.com/destination/blog/Amsterdam/
The first URL loads up the Amsterdam blog home while the second URL loads
up a post on the Amsterdam blog that starts with the word "amsterdam." The
reason for this is because !WordPress currently uses a case-sensitive
match on [http://core.trac.wordpress.org/browser/trunk/wp-includes/class-
wp.php#L164 line 164 in class-wp.php]. Since a case-sensitive match of a
form of home_url() isn't found in the requested path, the request URL is
never set up right. redirect_guess_404_permalink() ultimately ends up
redirecting the request in this case.
Changing the regex match to be a case-insensitive match on that line fixes
the problem, but it also allows that blog to then be loaded from multiple
URLs. Breaking canonical URLs like that would be bad obviously.
It seems that functionality needs to be added to not only handle the
canonical URLs for pages / posts, but also for blogs. I'm not familiar
enough with that code to attempt a fix, but I wanted to bring it up anyway
as this seems unintended.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17114>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list