[wp-trac] [WordPress Trac] #29858: Permalinks not redirecting from various types to setting value
WordPress Trac
noreply at wordpress.org
Sat Oct 4 01:01:17 UTC 2014
#29858: Permalinks not redirecting from various types to setting value
--------------------------+-----------------------------
Reporter: gmisura | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 4.0
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
On a fresh install of WordPress4.0, I changed the permalink structure to
"Day and Name" (i.e. yyyy/mm/dd/sample-post). If you go to /sample-post/
you are redirected to yyyy/mm/dd/sample-post (expected).
However, if you change the permalink structure to "Post Name" and you
request the url: 2014/10/03/hello-world/ you are not redirected to /hello-
world/ you get a 404 error.
I'd hope that is not intentional, and that this is a bug that can be
fixed.
Looks like this extends to other settings:
Some additional testing shows there's a few more bugs:
||= permalink =||= ?p=1 =||= /yyyy/mm/dd/hello-world/ =||= /yyyy/mm/hello-
world/ =||= /archives/1/ =||= /hello-world/ =||
||default ||HTTP 200 ||HTTP 200 ||HTTP 200
||HTTP 200 ||HTTP 200 ||
||Day & Name ||HTTP 301 ||HTTP 200 ||HTTP 301
||HTTP 404* ||HTTP 301||
||Month & Name ||HTTP 301 ||HTTP 301 ||HTTP 200
||HTTP 404* ||HTTP 301||
||Numeric ||HTTP 301 ||HTTP 301 ||HTTP 301
||HTTP 200 ||HTTP 301||
||Post name ||HTTP 301 ||HTTP 404* ||HTTP 404*
||HTTP 404* ||HTTP 200||
(The first column is the setting in wordpress, the top row is the
requested URL).
I would expect HTTP 301 for all of the HTTP 404*'s
I poked around the code (though debugging at midnight with a 6am alarm is
not smart) and putting in debugging statements, came to what I believe is
a problem in query not recognizing the postname in the URL when it comes
after dd. If I add ?name=hello-world, things start to act better (i.e.
permalink setting: post Name, /yyyy/mm/dd/hello-world/?name=hello-world
returns 301 and I get sent to /hello-world as expected).
My goal is to change a long existing blog from Day & name to Post name.
For SEO reasons, /post-name should be canonical and all other links should
redirect to it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29858>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list