Making WordPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1880 closed defect (bug) (fixed)

Add redirect for old numeric topic/forum slugs

Reported by: ocean90's profile ocean90 Owned by:
Milestone: Priority: normal
Component: International Forums Keywords:
Cc:

Description (last modified by ocean90)

It seems like bbPress 1.x had a fallback to the topic ID, see https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fja.forums.wordpress.org%2Ftopic%2F and https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fja.forums.wordpress.org%2Fforum%2F

A possible solution:

  • Store the old topic ID in a meta field _old_topic_id
  • In the redirect handler check if the slug of a topic is numeric
  • Query post meta for _old_topic_id
  • If meta exists redirect to new slug (cache result)
  • If it doesn't exist continue with the regular redirect (cache result)

Change History (15)

#1 @jmdodd
8 years ago

I stored the old bbPress 1 topic id as postmeta _bbp_old_topic_id in the bbPress 2 upgraded forum tables.

#2 @ocean90
8 years ago

  • Description modified (diff)
  • Summary changed from Add redirect for old numeric topic slugs to Add redirect for old numeric topic/forum slugs

We need the same for topics. (_bbp_old_forum_id exists too.)

#4 in reply to: ↑ 3 ; follow-ups: @ocean90
8 years ago

Replying to tenpura:

The solution @ocean90 wrote sounds promising but could we have numeric slugs like we used to have if we prefer? I think we chose that way with good reason in the old forum.

The only reason I see is "too much % signs" and I don't think that it's a good reason for having numeric slugs. It's 2016 and I think it's okay to have the actual title in a permalink. 🙂

#5 in reply to: ↑ 4 @netweb
8 years ago

bbPress fully supports numeric post slugs, by "fully supports" I mean we do, but there are known bugs :(

Related: #bb2698 / #bb2258

Another potential solution is to piggy back off of wp_old_slug_redirect, I've done this a few times for forum conversions in the past

#6 @tenpura
8 years ago

#1881 was marked as a duplicate.

#7 @jmdodd
8 years ago

Eventually, the plugin that I wrote for bbPress 1 will go away and all redirects from old locations will be handled by nginx. Any old id to new slug conversion needs to happen in bbPress 2 -- I'll work on a quick plugin to handle that.

We should try to keep all of the new forum settings uniform across languages for ease of support and development. Additional processing would be necessary in order to use both old ids and new ids as slugs; we'd essentially have to redirect twice, first from nginx to a definitely incorrect URL in order to differentiate between new correct ids and old ids that would need to be looked up.

I can use wp_old_slug_redirect as a model for the slug redirection needed for forums that used ids.

Version 0, edited 8 years ago by jmdodd (next)

#8 @jmdodd
8 years ago

In 3757:

Support: Redirect initial folder commit.

See #1880.

#9 @jmdodd
8 years ago

In 3758:

Support: Redirect initial commit.

See #1880.

#10 @jmdodd
8 years ago

In 3759:

Support: Use cleaned variable for $post_type comparison.

Props ocean90.
See #1880.

#11 @jmdodd
8 years ago

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

Activated plugin on ja.wordpress.org/support and tested with Google results, which now correctly redirect to the new topic/forum locations.

#12 in reply to: ↑ 4 ; follow-up: @SergeyBiryukov
8 years ago

Replying to ocean90:

The only reason I see is "too much % signs" and I don't think that it's a good reason for having numeric slugs. It's 2016 and I think it's okay to have the actual title in a permalink.

I'd tend to agree, but it would be great if Cyrillic slugs were not truncated at ~33 characters (it's more like half of the actual title for us, which doesn't look good or informative), see #1884.

Replying to jmdodd:

Activated plugin on ja.wordpress.org/support and tested with Google results, which now correctly redirect to the new topic/forum locations.

Could you activate it on ru.wordpress.org/support as well? We used to have numeric topic links in some plugins written for the ru_RU community, e.g. http://ru.forums.wordpress.org/topic/7292 in Restore Automatic Upgrade, and they were properly redirected before the upgrade.

#13 @SergeyBiryukov
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for comment:12.

#14 in reply to: ↑ 12 ; follow-up: @jmdodd
8 years ago

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

Plugin activated; I've confirmed that:
http://ru.forums.wordpress.org/topic/7292
now forwards to:
https://ru.wordpress.org/support/topic/%D0%9F%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD-%D0%B0%D0%B2%D1%82%D0%BE%D0%BE%D0%B1%D0%BD%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F-%D1%81-ruwordpressorg/

Replying to SergeyBiryukov:

I'd tend to agree, but it would be great if Cyrillic slugs were not truncated at ~33 characters (it's more like half of the actual title for us, which doesn't look good or informative), see #1884.

I think that a truncated slug is still more useful than a topic id.

#15 in reply to: ↑ 14 @SergeyBiryukov
8 years ago

@jmdodd: Thank you! :)

Note: See TracTickets for help on using tickets.