Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9512 closed defect (bug) (invalid)

Permalink redirection fails due to conflict with attachments

Reported by: firebird75 Owned by: ryan
Milestone: Priority: low
Severity: normal Version: 2.7.1
Component: Permalinks Keywords:
Focuses: Cc:


Here is a tricky one. I am not 100% sure that this isn't design intent.

So I have changed my permalink structure change from /%category%/%postname%/ to /%postname%/

The redirection of the posts works fine for all posts except when the post contains a picture that has the same name as the post name.

For instance, if I have a post called "nice car" which is accessible through the category "car review" and that contains an attachment called "nice car" :

  • before the migration, I can access the post through /car-review/nice-car/
  • after the migration, if I access through /car-review/nice-car/, I get an empty post with the picture "nice-car" and I am not redirected to /nice-car/ post (new permalink structure).

The picture remains in fact accessible from any directory /toto/nice-car/, /titi/nice-car/, even if it doesn't exist. It isn't a big deal. The issue is rather that it is accesible through an url that will have priority over the redirection to the post because of this.

I understand that this is a special case ;)

Change History (3)

#1 @ryan
12 years ago

Starting permalinks with %category% or %postname% is strongly not recommended.

#2 @Denis-de-Bernardy
12 years ago

  • Resolution set to invalid
  • Status changed from new to closed

marking as invalid: best I know, WP enforces old slug but only to the extent that the same permalink structure is used. if you change the permalink structure, well...

#3 @Denis-de-Bernardy
11 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.