[wp-hackers] Question about some annoyances I have
Jeremy Visser
jeremy at visser.name
Sun Apr 26 09:45:03 GMT 2009
On Sun, 2009-04-26 at 01:17 -0500, Arthur Pemberton wrote:
> The first is the use and enforcement of `siteurl`. Why is this option
> relied on so heavily and even redirected to? All the site resources
> use this absolute URL instead of base /wp-content url. I have my
> wordpress on my dev box, and simply showing it to a friend through my
> apache reverse proxy is unusually troublesome because of this.
The way I work around this is to set siteurl dynamically in
wp-config.php. I remember this method is vulnerable to injection via
Host header modification, but it works, and should be fine for your dev
box.
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wp');
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wp');
This will ignore whatever you set in the DB for wpurl and siteurl, and
will set them based on what the browser sends in the Host header.
Obviously, if your blog URL is different from where WordPress is, adjust
accordingly.
Hope this helps,
Jeremy.
More information about the wp-hackers
mailing list