[SOLVED] Added new Site, Redirecting to another site

Discussion in 'Installation/Configuration' started by Falrish, Jul 18, 2024.

  1. Falrish

    Falrish Member

    I have set up a new site on my system, and I am working to get it online.

    Running host and the domain on the machine shows the right IP
    The vhost file is all correct from what I can see.
    I have used the IP address in the Websites page of the control panel across the board for all my sites.
    The site is even under a different "user/client" to keep it segregated.
    However, it is forwarding to the main site on the IP address and not loading it's own system.
    Unless i type in www.domainname.com it redirects to www.mainsite.com

    Any help will be greatly appreciated. I can send screenshots if you need them
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Use this https://forum.howtoforge.com/threads/please-read-before-posting.58408/
    and post the report in CODE tags.
    You should show what commands you use and the output.
    Check again that really all websites have IP-address configured. Like the pleas read before article says, mixing IP-address and domain name causes a mess.
    So, with www. it works but plain domainname.com goes to wrong site? Did you check what name service shows for these hostnames?
     
    ahrasis likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The redirection can also be made by the system you installed on that site. For example, if you have WordPress installed on the site and you have set up the wrong domain in WordPress, this will happen. Many other CMS and shops do that, too. Besides that, the redirect can also be in a .htaccess file.

    Such a redirect can happen if you access the site by SSL but it does not have SSL enabled or no valid SSL cert.

    Or its a DNS problem where the www subdomain points to the right IP but the domain without www points to a different IP. Also check that you entered domain.tld into the domain field of the site and not www.domain.tld.
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You might want to try using asterisk instead of IP in the website setting, though this might not be related to your problem.

    You did enable www in your website's setting right?
     
    Last edited: Jul 19, 2024
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Looks like both www and the domainname have valid certificates.
    Remains to check if Wordpress (which seems to be running the site) does the redirect.
    There are two settings in Wordpress site database for the domain name, site_url and home_url, check their values. If you moved the website from some other address to here, these two settings must be changed.
    It may be a problem in browser cache. When I now test www and the domain name, both seem to work and show same webpage. It seems www direct to the plain domainname.

    If this issue is solved, please mark it solved by adding [SOLVED] to the topic. Top of page has "thread tools" dropdown menu.
     
    Last edited: Jul 19, 2024
  6. Falrish

    Falrish Member

    So I thought installing WordPress fixed the issue but it did not.
     
    Last edited: Jul 20, 2024
  7. Falrish

    Falrish Member

    so with further digging I have noticed that it is actually the http redirect to https that is failing.
    not sure why...I will read through the two sites config files and see what is going on there.

    And I found the issue. there was an Auto-Subdomain set to *. instead of www.
     
    ahrasis and Taleman like this.

Share This Page