Opened 18 years ago
Last modified 19 months ago
#3451 reopened defect (bug)
Page URI canonization
Reported by: | pah2 | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Permalinks | Keywords: | needs-patch needs-testing close |
Focuses: | Cc: |
Description
The nice permalink URIs for posts or categories are case-insensitive, but the page URIs are not.
e.g. http://matt.wordpress.com/about/
cannot be reached via
http://matt.wordpress.com/About/
This results in 404s being returned when a user incorrectly gets the case of the URI wrong. This is particularly a problem for weblogs that have migrated old pages to WordPress, and have external pages pointing to them with varying case applied to the URIs.
Attachments (1)
Change History (25)
#1
@
18 years ago
- Keywords needs-patch added
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
- Version set to 2.1
#2
@
18 years ago
For the record, page ID & lack of trailing slash (which we should also address) is currently accomplished via a great plugin which I use.
Examples:
http://www.viper007bond.com/about
http://www.viper007bond.com/?page_id=43
However, if we put something like this into the core, it needs a filter or a hook. That plugin currently has exclusion regex which is super helpful.
For example, this is my permalink structure:
http://www.viper007bond.com/archives/2006/12/01/blog-upgraded/
I cheat and have a page located at http://www.viper007bond.com/archives/. With the current code, you can't do that without breaking all your post permalinks (at least in 2.0.x it did). I accomplished it via a custom mod_rewrite
rule in my .htaccess
that loads up index.php/post-archives/
.
#4
@
17 years ago
- Milestone changed from 2.3 to 2.4 (next)
Not handled by current canonical redirect code, but it's too late to start working on it.
#5
@
17 years ago
Should the Canonical redirect redirect it in this case, Or should the page matches be done case insensitivly?
Do search engines treat different capitalised urls as seperate? (thinking double content here)
#6
@
17 years ago
My vote goes for redirect to whatever the user entered for the stub. On Linux, you could have a site.com/file.php
and a site.com/File.php
and those would be two different scripts.
#7
@
17 years ago
the canonical code redirects ?page_id=43 to the correct page allready.
I've just made a patch up which attempts to redirect pages, However, it may be too greedy for the likes of some.
Lets say i have a page structure like this:
Sub-marine About Me Sub about me sub-sub about me
The attached patch will redirect:
hostname/wordpress/abOUT-me/ => hostname/wordpress/about-me/ hostname/wordpress/abOUT-me/sub- => hostname/wordpress/about-me/sub-about-me/ hostname/wordpress/abOUT-me/sub-sub => hostname/wordpress/about-me/sub-about-me/sub-sub-about-me/ hostname/wordpress/sub- => hostname/wordpress/sub-marine/ hostname/wordpress/sub-sub => hostname/wordpress/about-me/sub-about-me/sub-sub-about-me/
Now, getting to the greedy part:
It also has the effect of redirecting things like:
hostname/wordpress/a => hostname/wordpress/about-me/ hostname/wordpress/su => hostname/wordpress/sub-marine/ hostname/wordpress/hta => hostname/wordpress/2007/11/05/htaccess/
In the case where there's multiple destinations possible, It selects the uppermost item alphabetically.
So hostname/wordpress/a will choose 'about-me' over 'azzes', and 'about-me' over 'parent/aaaa-sub-page'
If it comes accross a semi-permalink:
hostname/wordpress/perma/structure/post-na
it'll still redirect it to that post: hostname/wordpress/perma/structure/post-name/
rather than sending it to hostname/wordpress/post-nam/
#8
follow-up:
↓ 9
@
17 years ago
Another possible solution for multiple destinations possible is to pull up the search template and list out all the post/pages for the user to pick from.
#9
in reply to:
↑ 8
@
17 years ago
Replying to Viper007Bond:
Another possible solution for multiple destinations possible is to pull up the search template and list out all the post/pages for the user to pick from.
Thats a much nicer option IMO.
The present redirect code(in trunk) just redirects it to the first item it comes accross(unordered) that fits the criteria that its managed to find. On second thoughts, that $order statement could probably be hard coded for the query if its to select only one item.
#11
@
16 years ago
- Cc janbrasna added
- Component changed from General to Permalinks
- Milestone changed from 2.9 to 2.8
- Summary changed from Page URIs are case-sensitive to Page URI canonization
#14
@
15 years ago
- Milestone changed from 2.8 to Future Release
One day, we'll need to compile a huge ticket with all of the permalink problems...
#19
@
15 years ago
- Milestone 2.9 deleted
- Resolution set to fixed
- Status changed from accepted to closed
Not an issue any longer as reported. Will close as fixed. Anyway, as long as pplz are acutally getting a 404 this is not a bug.
#20
@
5 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Re-opening as an upstream report from dotorg meta: https://meta.trac.wordpress.org/ticket/4409
I'm not sure this ticket should have been closed, since others were closed as dupes.
#22
@
2 years ago
- Keywords needs-testing added
I can't seem to reproduce this in 6.1-alpha trunk
.
- The links in the ticket's summary all go to the expected page.
- The links in Meta ticket 4409 all go to the expected page.
- Visiting http://localhost/mysite/sAmPlE-pAgE loads the Sample Page.
Adding needs-testing
to have another contributor confirm whether this issue still occurs.
For 2.2, I'd like to have some form of automatic URL correction in core... so if you're using http://example.com/about/ and someone puts in http://example.com/About/ or http://www.example.com/about/ or http://example.com/About/ or http://example.com/?page_id=2 or any number of "close, but not quite" URLs, it'll 301 to the real URL. That's good for search engine juice!