What's the best way to view a website in development or transfer?

Discussion in 'General' started by Tomislav Aurednik, Oct 6, 2016.

  1. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    I like to know the best practices of viewing websites on the server that don't have a registered domain or are hosted on a different server.
    I know the way with the hosts file, but that option doesn't work with clients. Not every one knows how to do it. So what are other "easier" ways of doing this.
    Do you use subdomains, have a registered test domain that you have only for viewing sites or something else?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    You can edit the hosts on windows10. But you must open the with the administrator-account.
     
  5. ZeroEnna

    ZeroEnna Member

    Well. what about the most OBVIOUS solution?
    Like...I don't know...create a subdomain like "dev.example.com" and then later change the domain in ISPConfig to example.com and/or overwrite the existing site.
     
    CreeWarrior likes this.
  6. Jesse Norell

    Jesse Norell Active Member

    A different name (dev subdomain or such) can work, but you have to be careful with embedded url's not referencing the temp/staging name. Ie. a site working at dev.whatever.com could break when deployed as www.somethingelse.com. I have had pretty good luck doing this (in wordpress and drupal sites) if you are careful to keep the dev and production hostnames the same string length, then when you move to production, take a database dump, do a string replacement on the dump from old to new name, then load into the production database. Also double-check .htaccess files; likely your html/code files won't have a hostname hard-coded, but a quick grep should find any spots.

    Depending on how much work you want to put into your side of it, you could probably create a reverse proxy config to do this, eg. say you have 'demo.mydomain.com' for this purpose, you could add a website to your server (just use hosts file changes while you build it), then setup a reverse proxy url of http://demo.mydomain.com/www.customerdomain.com/ to proxy connect to the local ip address and request the right site name. (Might have to edit the hosts file on the webserver, too, I've not actually done that.)

    A forward proxy would be another option, but again you have to have the client configure their side, which you were trying to avoid.
     
    Tomislav Aurednik likes this.
  7. CreeWarrior

    CreeWarrior Member

    Hi,
    I think the easiest would be to create a subdomain like @ZeroEnna said. Its easy and quick to get a working demo. And just keep in mind what @JesseNorell said about hard coding urls
     
    Tomislav Aurednik likes this.

Share This Page