Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#6627 closed enhancement (wontfix)

Canonization, individual editing of permalinks

Reported by: synapsestudios's profile synapsestudios Owned by: markjaquith's profile markjaquith
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: Canonical Keywords: needs-patch
Focuses: Cc:

Description

It would be nice to see an option to view all permalinks available. Currently only one is shown even though multiple exist. Possibly using a method similar to Google calendar telling you "+4 more" which is a link that displays all the other ways to access that post/page.

Also, I am not sure if it is possible but it might be useful to some to be able to have different slugs for the same article.

Example:
-- slug of test exists in category-a
-- create a new post with a slug of test in category-a and category-b which becomes test-2 across the board
-- allow for user to specify category-a/another-test and category-b/test

Change History (25)

#1 @synapsestudios
16 years ago

  • Milestone 2.6 deleted

#2 @ryan
16 years ago

Do you mean post permalinks? There is only one permalink for a post. We go trough pains to make sure there is only one canonical permalink for a given post. That canonical link is the only one that should be used or displayed.

#3 follow-up: @synapsestudios
16 years ago

With a post permalink, there can be multiple ways of accessing that post depending on how the permalink structure is created. For example, my permalink structure is as follows: /%category%/%postname%/

Which means when I have a post in more than one category, there is more than one way to access the same post.

Additionally, the same content can be reached via author/{authorName}/{postSlug}

#4 in reply to: ↑ 3 @ryan
16 years ago

Replying to synapsestudios:

With a post permalink, there can be multiple ways of accessing that post depending on how the permalink structure is created. For example, my permalink structure is as follows: /%category%/%postname%/

Which means when I have a post in more than one category, there is more than one way to access the same post.

That is a deficiency in our canonical redirect code then.

Additionally, the same content can be reached via author/{authorName}/{postSlug}

That's not really a permalink. Perhaps canonical redirect should redirect author links containing post slugs to the post's canonical permalink.

#5 @DD32
16 years ago

  • Milestone set to 2.7

#6 @markjaquith
16 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

I'll handle the category situation for 2.7 The author situation seems contrived. WordPress would never generate those links.

#7 @markjaquith
16 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9193]) Redirect alternate is_single() URLs (like multiple category-based urls) to the canonical URL. fixes #6627

#8 @alexrabe
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Since [9193] my rewrite rules (Plugin : NextGEN Gallery) for post are not longer working anymore... I'm not sure if I done it in the past in a wrong way but the line

$redirect_url = get_permalink( url_to_postid( $requested_url ) );

Removes all my query args for posts. How should I add now additional args to the post url ?

#9 @GamerZ
16 years ago

@alexrabe: I also have this problem for my WP-Email and WP-Print plugin, what I did was to have template redirect loads first before the canonical url. This is what I did

!php
add_action('template_redirect', 'wp_print', 5);

#10 @alexrabe
16 years ago

Thanks for the note GamerZ,

I'm not sure if I can use it in this way... I request the args with get_query_var() during my shortcodes are proceeded, don't thinks I can use here a template redirect. Maybe I understand this whole rewrite sytems not fully and I'm doing something terrible wrong. I will have a look for your plugins

#11 @GamerZ
16 years ago

I see, I think I got what you mean. ShortCode are parsed at the the_content() level and hence I think the canonical url redirect has already taken place.

In canonical.php, if you comment out this line

add_action('template_redirect', 'redirect_canonical');

does it work?

I tried many methods, using the WP rewrite endpoints API and it seems that it will not detect other query vars except its own.

#12 @alexrabe
16 years ago

Yes it works when comment out the redirect_canonical. If I hook into url_to_postid() I see taht it will now passed two times... the first time it return the correct query but due to the redirect it will then not longer contain my query args.

@markjaquith
Do we really need [9193] in WP 2.7 ?

#13 @ryan
16 years ago

  • Component changed from Administration to Permalinks

#14 @alexrabe
16 years ago

@mark
Is it possible to get some feedback before WP2.7 will be released ?

#15 @markjaquith
16 years ago

I'm a little bit confused about the problem you're having. I have no problem passing arbitrary query strings:

http://mark-mbp.local/~mark/wp/2008/11/private/?foo=bar

Does not redirect.

#16 @markjaquith
16 years ago

Ah, you mean additional things on the path. Like:

http://example.com/2008/11/postname/gallery/

I can roll this back pending a more cautious fix. Maybe compare the canonical URL to the current URL to see if they are the same + some suffix. But this is fine to punt to 2.8

#17 @markjaquith
16 years ago

(In [9649]) Revert [9193]. See #6627. Will revisit for 2.8

#18 @jacobsantos
16 years ago

  • Milestone changed from 2.7 to 2.8

#19 @alexrabe
16 years ago

Many thanks for your decision, let me know if I should change anything in my rewrite rules for 2.8

#20 @janbrasna
16 years ago

  • Cc janbrasna added
  • Keywords permalink slug canonization added
  • Summary changed from View all permalinks + individual editing of permalinks to Canonization, individual editing of permalinks

Related #3451 (see comments).

#21 @Denis-de-Bernardy
15 years ago

  • Component changed from Permalinks to Canonical
  • Keywords needs-patch added; permalink slug canonization removed

#22 @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.8 to Future Release

Moving to Future, pending a patch

#23 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Future Release to 2.9

#24 @ryan
15 years ago

  • Milestone changed from 2.9 to Future Release

#25 @dd32
14 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed

wontfix: We already redirect singular posts; ticket: Having multiple entry points for a post also goes right against having Canonical in the first place.

Note: See TracTickets for help on using tickets.