WordPress.org

Ready to get started?Download WordPress

Forums

Site URL and Localhost? (8 posts)

  1. michaelng
    Member
    Posted 8 years ago #

    Just like many others, I have a cable connection with an ip that changes from time to time; so I have a dynamic service from dyndns.org that map to my changing ip address. So when I set up my WP, my WP address is:
    WordPress address (URI): http://mysite.dyndns.org:9999/wordpress

    The problem with this is that if I try to do:
    http://localhost:9999/wordpress

    localhost cease to exist and errored out. WordPress does not recognize localhost as a valid address. The main flawed with this implementation is that everytime I update the site from within my internal network, I have to use the dynamic address (mysite.dyndns.org) which causes significant slowness. It's slower, I presume is because it has to go out and lookup the dynamic address and then loopback to my box.

    Has anyone noticed this? or has a solution that I don't know about? It seems like this is a major flawed in an otherwise very clean application. Most applications allows you to do a dynamic address as well as localhost to view the site when you are on the same box. I don't understand why WordPress need to be any difference?

    Any guru, please explain my ignorant?

    Thanks

  2. mylagoon
    Member
    Posted 8 years ago #

    WordPress does not recognize localhost as a valid address

    WordPress certainly recognizes localhost as a valid address for me. I'm not familiar with your setup (do you intend for your WordPress installation to be publicly available, or only for personal use?).

    But if it's just so you can run WordPress locally on your computer, I'd suggest you look into programs such as this one:

    http://www.apachefriends.org/en/xampp.html

  3. michaelng
    Member
    Posted 8 years ago #

    My WordPress installation is meant to be publicly available to those who knows the address. So yes, I have WP running on a home linux box with apache and mysql.

    The problem I am having is that since WP requires that you specify <b>WordPress address (URI)</b>, you need to use the url to access the site. I can't simply do http://localhost/wordpress. I have to use whatever I specified in the URI field.

    Maybe, I am missing something if someone can explain to me how I can specify an address in the URI field and also have localhost to work.

    mylagoon - if you care to post your settings for:

    WordPress address (URI): http://www.mylagoon.com
    Blog address (URI): http://www.mylagoon.com

    Is that how you have yours setup and your localhost still works?

    Thanks

  4. TechGnome
    Moderator
    Posted 8 years ago #

    michaelng - you can't have it both ways. The reason for this is because WP stores the URL/URI in the database and uses that to build all the links and include files and such. So if you set it up so that you can view through localhost, no one out side will see it. If you set it up to use the dynamic dns, then it can't be viewed as localhost. That's simply the way it is.

    In general, however, it's not a good idea to be doing the tinkering on your live site anyways (all things being equal, something *will* go wrong.) What you may want to consider doing is creating a second WP installation that is linked to localhost (but uses a different database from your main site) and do your tweaking there. When it's all set, simply copy the files from test to live.

    -tg

  5. michaelng
    Member
    Posted 8 years ago #

    Thanks TechGnome, I wanted someone to tell me that it's not possible which is what I figure.

    Yes your are right about tinkering with a live site, but since it only hosting my own stuff; I can risk it a little. :-)

    Thanks for the answer.

  6. ziaulhasan
    Member
    Posted 8 years ago #

    Hi,
    I am facing exactly the same problem with wordpress. I am also using a connection which changes my ip from time to time. So I am using dyndns address for my blog. The problem is that either if I change it from localhost to dyndns domain then I need a anonymous proxy which makes it a very slow. Just to make a check I made the URL empty. Funny thing is now when I go to http://localhost/wordpress/ I see the following message
    It doesn't look like you've installed WP yet. Try running install.php.
    And when I tried to install
    http://localhost/wordpress/wp-admin/install.php
    Message was:
    Already Installed
    You appear to have already installed WordPress. To reinstall please clear your old database tables first.

    Although I could recreate the blog as I haven't started much but I don't know why are the links generated using some fixed URL. application needs a change. why not directly from contextpath.

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Why not override mysite.dyndns.org in your hosts file with the address 127.0.0.1? That way, you'll never go to DNS to look it up, since it will resolve in the hosts file.

  8. HedgeHog
    Member
    Posted 8 years ago #

    I've posted these before. They helped me get xampp up and running. WordPress is a breeze with xampp. I usually work out all the bugs on my system before going live.

    http://mezzoblue.com/archives/2004/08/05/virtual_host/index.php
    http://practice.chatserve.com/hosts.html

    HH

Topic Closed

This topic has been closed to new replies.

About this Topic