[wp-trac] [WordPress Trac] #12456: Canonical URL redirect issue with post_id/postname permalink structure

WordPress Trac noreply at wordpress.org
Thu Feb 15 07:50:04 UTC 2018


#12456: Canonical URL redirect issue with post_id/postname permalink structure
------------------------------------------+-----------------------------
 Reporter:  Frank.Prendergast             |       Owner:  dd32
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:  Future Release
Component:  Canonical                     |     Version:  2.9.2
 Severity:  normal                        |  Resolution:
 Keywords:  tested 3.3-early needs-patch  |     Focuses:
------------------------------------------+-----------------------------

Comment (by anbumz):

 Replying to [comment:25 calvin_ngan]:
 > Replying to [comment:24 Niresh12495]:
 > > @calvin_ngan this solution relatively works for all domains simply add
 this to your .htaccess, i have been using this on my blog
 [http://www.niresh.guru] since a long time but Wordpress must fix this
 with PHP so im reopening this ticket
 > >
 > > {{{
 > > RedirectMatch 301 ^/(\d+)/$ /?p=$1
 > > }}}
 >
 > 1. Nobody gave him a temporary solution, thus, I posted one.
 > 2. After 7 years, it is still not taken care of, I doubt they see this
 as bug. Probably will never be resolve.

 Very unfortunate that this is not an in-built Wordpress feature as it
 causes problems with search engines and analytics. This .htaccess solution
 works like a charm, however.

 How would you have to change the expression to capture URLs like this as
 well: /lc/post_id/ whereas lc is a two-character language code like "en"
 for english or "de" for German and so on. This is relevant for
 multilingual plugins such as WPML. Redirection destination then would be
 /lc/post_id/post_name/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/12456#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list