Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between wp_siteurl and wp_home

Tags:

wordpress

What's the actual difference between wp_siteurl and wp_home?

There's a related post which doesn't quite answer the question:

Wordpress WP_SITEURL and WP_HOME values?

like image 795
Snowcrash Avatar asked Sep 15 '14 21:09

Snowcrash


2 Answers

WP_SITEURL is a base url for resources: images, stylesheets, etc.

WP_HOME is where WP thinks site root url is (a base URL for links)

Example: I had to integrate WP blog into my rails site, so i configured nginx to route all requests to /blog to WordPress, while all other requests went to my rails app. So I set WP_HOME to mydomain.com for WP links to work correctly, but I had to set WP_SITEURL to mydomain.com/blog for WP static assets to be found inside WP directory.

like image 79
IvanSelivanov Avatar answered Oct 15 '22 03:10

IvanSelivanov


Lets consider your awesome website's domain name is -

http://www.myawesomesite.com

Now one fine day you want to start a blog at this location -

http://www.myawesomesite.com/myniceblog

Now, answering your question -

WP_SITEURL = http://www.myawesomesite.com  //Your awesome wesbite's domain name
WP_HOME = http://www.myawesomesite.com/myniceblog  //Your awesome blog's homepage path

For further info - see this Wordpress article.

like image 6
Sujit Agarwal Avatar answered Oct 15 '22 03:10

Sujit Agarwal