Support » Localhost Installs » ERROR:LOCALHOST SITE DOES NOT RESPOND TO ITS OWN IP ADDRESS

  • Hey guys!!!
    I have a localohost site in XAMPP and everything goes well when i type localhost/mysite but when i try to access it with my IP it does not load..I have changed the settings in siteaddress and wordpressaddress from localhost to my IP address because that’s the only way that it opens right in other computers of my LAN.But it seems that my machine does not respond to its own IP address.Is there any idea how to solve this problem???
    Thank you!!!

    • This topic was modified 2 weeks, 6 days ago by  Steve Stern.
Viewing 6 replies - 1 through 6 (of 6 total)
  • I’ll assume you’re trying to load WordPress. (You’re in the wrong place if it’s anything else!)

    WordPress hardcodes its full domain, and that means it can only be access with that domain. So take your choice: localhost/mysite or xxx.xxx.xxx.xxx/mysite because you can’t access WOrdPress with both.

    Now, having said this, you can access WordPress using both (WP4.9+), but you will lose access to live preview in the Customizer. If you add the following to your wp-config.php file:

    define('WP_SITEURL', '/mysite');
    define('WP_HOME', '/mysite');

    you should be able to access your site using either URL. In addition, all URLs saved by WordPress will be relative and not absolute. That means your site can be moved without DB modifications to any other server that uses the same relative address.

    It’s a great solution for anyone planning to migrate from localhost to a live site, but see above about the Customizer. FWIW, I’ve checked the code and the live preview issue with relative URLs is IMO a bug in the Customizer. I doubt whether it will ever be fixed, though, since WordPress does not officially support relative URLs for the ‘siteurl’ and ‘home’ options.

    THANK YOU SOOOOOO MUCH!!!!!!!!!!!!!!
    I have no words to say for your help!!!!These information there were nowhere on the whole internet!!!!YOU SAVED ME!!! πŸ™‚ πŸ™‚ πŸ™‚

    I’m glad it worked for you. I’ve been using this trick for years when developing sites for myself and for clients. (I must now hack WordPress to allow the Customizer live preview to work correctly, but that’s a small price to pay.) It’s why I laugh every time I see people using and recommending plugins and convoluted procedures to fix something that never needed to be fixed. πŸ™‚

    Here’s another unknown-to-the-internet tidbit. There is a specific value for the siteurl option that will cause the “Error establishing database connection” error, even though WP has successfully connected to the database!

    Yes it worked really well!! I know but the truth is that WordPress itself should have given answers to the public that is struggling with common issues like that.I have read so many forums and nobody had any kind of idea of how to solve this.
    Well,i don’t have the error establishing database connection but i have the RSS error of connecting to any site on the web and the “An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.” when i try to add a new theme or a plugin.This warning also appears “WordPress could not establish a secure connection to WordPress.org”. Do you have any solution about this stuff?

    PROBLEM AGAIN!!!!! After i changed the siteaddress and wordpressaddress to the way that you showed me, i can access it from my machine but when i type its address in other computers in my LAN it doesn’t open again…It loads a message that has an ACCESS DENIED written on it.What should i do???? What should i type to open it? Thanks again

    pleaseeeeeeee if you have an idea i would be really grateful

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.