WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm starting wordpress development, and learning the platform. Now I'm stuck with a strange issue. I have created a virtual host configuration that works as expected. I'm using xip.io for dns resolution, that also works as expected I can access wordpress application from other devices.

The thing that puzzles me is that if I define WP_HOMEURL and WP_SITEURL variables to the same values that are set via admin->options -> general settings the whole thing breaks. Nothing works anymore, I have to go directly to the database to reset site_url field.

The virtual host file

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example_dot_com
    DocumentRoot "C:/server/wp/wordpress"
    ServerName theme.local
    ServerAlias local.
    ErrorLog "logs/test1.com-error.log"
    CustomLog "logs/test1.example.com-access.log" common

Settings in the admin UI

WordPress Address (URL) :  http://local.
Site Address (URL)  :  http://local.

I thought that those values are the same, and that it makes no difference how you define them (wp-config.php or via admin interface)?

Obviusly I'm doing something wrong, but I can't see what is it.

share|improve this question
What do your wp-config.php lines look like? – s_ha_dum May 30 '13 at 15:08
` define( 'WP_SITEURL', 'local.'); define( 'WP_HOMEURL', 'local.' ); ` – iki_xx May 30 '13 at 16:26
edit: somehow back tick don't work for code formating. – iki_xx May 30 '13 at 16:35
You did something wrong. Backticks do work in the comments. – s_ha_dum May 30 '13 at 16:36
up vote 0 down vote accepted

The constants you need to define are WP_HOME, not WP_HOMEURL, and WP_SITEURL, and you need to complete address. Your addresses are missing the scheme-- http://

define( 'WP_SITEURL', 'http://local.'); 
define( 'WP_HOME', 'http://local.' ); 

Without the scheme, WordPress treats those URIs like relative addresses. You can see that in the address bar if you watch what is happening.

share|improve this answer
Thank you, it appears that all I needed was a fresh pair of eyes. Even when I was posting the code here I didn't notice that I'm missing http:// scheme. Also the variable name.... – iki_xx May 30 '13 at 18:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.