Preview adress for development

Discussion in 'General' started by Icey, Aug 16, 2017.

  1. Icey

    Icey New Member

    If my servers base domain is "xxx.com" and now I'm developing a site for a customer for their domain "yyy.com" which is hosted elsewhere publicly but set up in my ISPConfig as a site. How do I create a preview adress for this one going like this: "yyy.com.preview.xxx.com"?

    Of curse I can do this in the hosts-file but for some client's, especially if there is a team this is hard. And sometimes they also forget to change it back when it goes live which creates big problems.

    So, how do I set up an automatic preview adress for the sites I'm developing?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    See System > Server config > web > Website auto alias
     
  3. Icey

    Icey New Member

    Thanks for your answer. But sorry, I should had added that I've already set that up. I also set up my DNS to *.com.preview A ip.ip.ip.ip

    What happens now is when I go to "yyy.com.preview.xxx.com" I'm forwarded to "yyy.com". Which solves nothing because of "yyy.com" is the old site hosted elsewhere. Instead of what I want to happen, that the site on my hosting on the domain "yyy.com" should show up.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    This forward is done by the CMS system in your website and not by ISPConfig.

    When you use a cms that enforces the main domain that you entered in the CMS like it seems to be in your case, then editing the hosts file is the only solution if you do not want to change the settings in the CMS to the dev alias domain.
     
  5. Icey

    Icey New Member

    Ahh, that makes a lot of sense. Tanks!

    But, I'm using WordPress on this site. and other hostings can set up a preview-adress that works even when WordPress is set to the intended domain.

    These other providers (Loopia and CitySites here in Sweden) do you have any idea how they solved that? I know that it's noting inside the "web-folder" and nothing with the sites root .htaccess because that's under user control.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    It might be that they setup a separate proxy vhost or something similar.
     
  7. nhybgtvfr

    nhybgtvfr Member

    in the preview wordpress site, set the home_url and site_url to yyy.com.preview.xxx.com
    either in the wordpress backend, or if that's already broken/redirecting to yyy.com now, directly in the wordpress database, in the wp_options table.
     
  8. Icey

    Icey New Member

    Thanks! Kan you point me in the right direction? I want this to be automated for all new sites so they always have a preview adress "yyy.com.preview.xxx.com" who acts as if it where "yyy.com" on my hosting.
     

Share This Page