Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.191.161.3.101.xip.io
    ErrorLog "logs/test1.com-error.log"
    CustomLog "logs/test1.example.com-access.log" common
</VirtualHost>

Settings in the admin UI

WordPress Address (URL) :  http://local.191.161.3.101.xip.io
Site Address (URL)  :  http://local.191.161.3.101.xip.io

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.192.168.3.101.xip.io'); define( 'WP_HOMEURL', 'local.192.168.3.101.xip.io' ); ` –  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

1 Answer 1

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.192.168.3.101.xip.io'); 
define( 'WP_HOME', 'http://local.192.168.3.101.xip.io' ); 

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

 
discard

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.