Accessing site before DNS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • toecheese1
    Member
    • Feb 2005
    • 34

    Accessing site before DNS

    I'm trying to create a website in Wordpress before I turn it up in DNS (moving hosting providers).

    I can get to the site via mainsite\~newsite, but I can't do much with it since it expects everything to be related to the new host name.

    Any ideas?
  • AndrewT
    Administrator
    • Mar 2004
    • 3653

    #2
    You'll have to configure Wordpress to use the preview URL and then revert it to the actual domain before making the DNS changes.

    Comment

    • ZYV
      Senior Member
      • Sep 2005
      • 315

      #3
      Alternatively you can set up a record in the "hosts" file.

      Comment

      • AndrewT
        Administrator
        • Mar 2004
        • 3653

        #4
        Originally posted by ZYV
        Alternatively you can set up a record in the "hosts" file.
        This is probably a much better idea as the preview URL doesn't play well with all PHP scripts and especially custom php.ini files that you create.

        Comment

        • toecheese1
          Member
          • Feb 2005
          • 34

          #5
          Ah- I was reading your post about fooling the local DNS, ZYV. I'll try that.

          Hmm, didn't work. It still resolves to the 'old' site, even after reboot.
          Last edited by toecheese1; 01-25-2009, 01:42 PM.

          Comment

          • toecheese1
            Member
            • Feb 2005
            • 34

            #6
            I'm not able to do it with Fantasticso because I don't get a choice on the domain name to which it belongs. I might set up a fake domain (and use the hosts trick to make it resolve) and install it there- not sure how easy it is to 'move' a domain from 'fakedomain.com' to 'realdomain.com'. Guess I'll cross that bridge when I get to it.

            Comment

            • AndrewT
              Administrator
              • Mar 2004
              • 3653

              #7
              There are settings within the script that define the URL from which it operates. These can be changed after installation.

              Comment

              • Frank Hagan
                Senior Member
                • Mar 2004
                • 724

                #8
                I've done it two ways ... one is to change all the references to one URL to the temporary one. Sometimes that's not too hard, especially when the script references relative urls. But it can get troublesome if you have to install several scripts for a customer.

                In another case, I registered the .org version of the domain name and created the site for testing and to show the customer. When they were satisfied, I renamed all the URLs, we made the DNS changes and I submitted a ticket to Dathorn to change the domain to the .com version.

                Its still a lot of work, but it made for a nearly seamless transition.

                Comment

                • ZYV
                  Senior Member
                  • Sep 2005
                  • 315

                  #9
                  It should work unless you did something wrong, I've been doing this stuff for ages. Make sure that you edited the correct file on your local machine (/etc/hosts or %WINDIR%\System32\drivers\etc\hosts) and the record you added on a separate line was like "123.45.67.89 host.com www.host.com". No reboot is needed. Use "nslookup host.com" to check how it resolves.

                  BTW, if you want to go this fake domain way, you don't really need any transition at all. Just set up an account for your future domain and then park the fake domain there using "Add parked domain" in cPanel. You will be able to remove it seamlessly when you are done.

                  Comment

                  • Frank Hagan
                    Senior Member
                    • Mar 2004
                    • 724

                    #10
                    Originally posted by ZYV
                    It should work unless you did something wrong, I've been doing this stuff for ages. Make sure that you edited the correct file on your local machine (/etc/hosts or %WINDIR%\System32\drivers\etc\hosts) and the record you added on a separate line was like "123.45.67.89 host.com www.host.com". No reboot is needed. Use "nslookup host.com" to check how it resolves.

                    BTW, if you want to go this fake domain way, you don't really need any transition at all. Just set up an account for your future domain and then park the fake domain there using "Add parked domain" in cPanel. You will be able to remove it seamlessly when you are done.
                    The HOSTS file trick is a good one for creating the site before the DNS records are changed, but it probably won't work to show your customer the site before hand-over. It could, but then you would have to make sure they re-edit it each time they visit their existing site, etc.

                    In that case, ie. the customer reviewing the site, you still need to have the domain names in all the scripts changed. In most php scripts I'm using, its only in a few places anyway.

                    Comment

                    • toecheese1
                      Member
                      • Feb 2005
                      • 34

                      #11
                      Thanks guys- the fake domain trick is working so far from my machine. I don't know why the 'real' domain won't resolve based on my windows hosts file. I thought it might be a dns cache in my cable modem or router, but that seems unlikely.

                      Comment

                      • Frank Hagan
                        Senior Member
                        • Mar 2004
                        • 724

                        #12
                        Did you try Start * Run, CMD (Enter), and then enter "ipconfig /flushdns" at the command prompt that comes up?

                        Windows is supposed to honor the HOSTS file right away, and certainly after a reboot, but I've found it necessary to flush the DNS manually on occasion.

                        Comment

                        • ZYV
                          Senior Member
                          • Sep 2005
                          • 315

                          #13
                          Yet another reason to go GNU And please bear in mind, I'm not strating off a holy war but spreading the word... he-he.

                          Comment

                          Working...