#1880 closed defect (bug) (fixed)
Add redirect for old numeric topic/forum slugs
Reported by: | ocean90 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | International Forums | Keywords: | |
Cc: |
Description (last modified by )
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)
#2
@
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.)
#3
follow-up:
↓ 4
@
8 years ago
Confirmed. Old topics and forums URLs redirect incorrectly to 404 pages.
https://ja.forums.wordpress.org/topic/158995
https://ja.forums.wordpress.org/topic/158991
https://ja.forums.wordpress.org/topic/159010
https://ja.forums.wordpress.org/topic/158993
https://ja.forums.wordpress.org/topic/158965
https://ja.forums.wordpress.org/forum/10
https://ja.forums.wordpress.org/forum/3
https://ja.forums.wordpress.org/forum/1
https://ja.forums.wordpress.org/forum/11
https://ja.forums.wordpress.org/forum/5
https://ja.forums.wordpress.org/forum/4
https://ja.forums.wordpress.org/forum/9
https://ja.forums.wordpress.org/forum/8
https://ja.forums.wordpress.org/forum/2
https://ja.forums.wordpress.org/forum/7
https://ja.forums.wordpress.org/forum/6
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.
#4
in reply to:
↑ 3
;
follow-ups:
↓ 5
↓ 12
@
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. 🙂
#7
@
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.
#11
@
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:
↓ 14
@
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
@
8 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for comment:12.
#14
in reply to:
↑ 12
;
follow-up:
↓ 15
@
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.
I stored the old bbPress 1 topic id as postmeta
_bbp_old_topic_id
in the bbPress 2 upgraded forum tables.