[wp-trac] [WordPress Trac] #33581: Use history.replaceState instead of 301 redirects for canonical urls

WordPress Trac noreply at wordpress.org
Tue Sep 15 12:00:30 UTC 2015


#33581: Use history.replaceState instead of 301 redirects for canonical urls
-----------------------------------+--------------------------------------
 Reporter:  peterwilsoncc          |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Canonical              |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |     Focuses:  javascript, performance
-----------------------------------+--------------------------------------
Changes (by peterwilsoncc):

 * keywords:  needs-patch 2nd-opinion => 2nd-opinion has-patch


Comment:

 I've uploaded a patch, if nothing else it gives SEO advisors something to
 work with.

 The patch is quite conservative about attempting to use
 history.replaceState - deferring to a 301 redirect if anything could go
 wrong.

 Concerns:
 * `$do_redirect` is no longer concrete, more of a maybe
 * counting preg_replace hits - is this expensive???
 * `$compare_redirect_origin` and `$compare_original_origin` might need
 better names too, now I think of it.

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


More information about the wp-trac mailing list