[wp-trac] [WordPress Trac] #17048: URLs delivered to the browser should be root-relative

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 17 02:20:28 UTC 2011


#17048: URLs delivered to the browser should be root-relative
-----------------------------+-----------------------
 Reporter:  dmole            |       Owner:  edwardw
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:
Component:  General          |     Version:  3.1
 Severity:  normal           |  Resolution:
 Keywords:  close            |
-----------------------------+-----------------------

Comment (by dmole):

 Replying to [comment:28 dd32]:
 > ... You'd be far better off implementing this as a plugin...

 It this actually within the reach of a plugin?

 > One example for reasons a absolute url is easier, is when moving the
 site to another domain, You can simply replace all the site url's. With
 this solution, You can't reliably move it between directories,

 This is wrong; please see comment# 3, or provide an example.

 >moving between hosts is fine, just as long as all paths end up the same.
 You'd also have to investigate Exports/Imports, as that would be affected
 too.

 Good pointer.

 > Long story short, to me, It's not a problem that needs fixing, In the
 sense, that there are other solutions available already which fill the
 needs mentioned in this ticket. the output buffering items mentioned above
 are one method,

 As mentioned the output buffering is not a solution, if you have a method
 that addresses comment# 14:

 'with more testing it becomes clear that the ob_start options are unusable
 because it misses headers like those used in redirects to wp-login.php,
 and it gets urls it should not like the "siteurl" setting itself.'


 >my favourite method is to dynamically define WP_SITEURL/WP_HOME, or
 filter the siteurl option, or filter the
 site_url()/admin_url()/includes_url()/home_url() returns to respect the
 current hostname, etc.. there's always a method which suits the
 site/environment in question.

 I'm not sure how one would do this can you provide an example?

 > Adding the close keyword again, to signify/track, that multiple
 developers have suggested it be closed, removing it doesn't change that
 decision.  Also, It's a feature request to use root-relative links, as
 using absolute url's is not a bug, rather a decision.

 We understand it's decision that was made for unknown reasons and if it's
 going to stay I would recommend at least checking for it and giving the
 user a warning instead of showing a partially broken page. As you
 mentioned a plugin would be ideal but I don't think it's within the power
 of a plugin so we will keep a patch for users to use regardless of if the
 core developers use it.

 If edwardw's patch is polished a bit it would remove the only reasonable
 argument against changing to root relative urls ("it is work"), so it
 would be great if a dev could provide any other reason not to use root
 relative urls or better yet help him improve the patch.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17048#comment:29>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list