[Solved] Subdomain not redirecting properly

Discussion in 'Installation/Configuration' started by anark10n, Nov 11, 2021.

Tags:
  1. anark10n

    anark10n Member

    Hey there. So, I have two simple sites, each with a subdomain to see if the subdomains redirected properly. In one case, it redirects to the correct URL, but opens the index.html of the main website's root directory instead of the index.html in the subdomain directory. And the other case has a wordpress site installed, and it doesn't rewrite the URL at all and just opens the main site.
    I don't quite understand what's happening here.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    How are you doing the redirecting?
    And this is without using ISPConfig, correct?
     
  3. anark10n

    anark10n Member

    Both were configured with ISPConfig. As for the redirect, it's Sites -> Subdomain for website -> Add new subdomain. The only thing I did outside of ISPConfig was creating the directory.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I've moved your post to the ISPConfig forum.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If worpress site is moved to another url, it has site_url and home_url settings that must be changed, otherwise wp dirercts to the old url. I may remember the names of those settings wrong, use internet search engines.
    Did you read ISPConfig manual on those subdomains and redirects?
     
  6. anark10n

    anark10n Member

    Thanks for the assistance. The client for the domain with the wordpress requested a separate wordpress installation from the main domain. I tried using the vhost subdomain, and I'm still getting the behaviour where the subdomain just redirects to the main domain.
    Edit: On a different browser (Brave, testing with Firefox before), the subdomain for the wordpress site redirects to an index.html page of another blank, even though the subdomain folder already has a wordpress files inside it and none of the default files.
    Also, I have no redirect options for either the main domain or subdomain.
     
    Last edited: Nov 12, 2021
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  8. anark10n

    anark10n Member

    Both domain and subdomain use HTTPS, and they're both listening on *, even the other website that I tried testing a simple subdomain with.
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ISPConfig Manual version 3.1 on page 143 states:
    Have you read Chapter 4.6.1.2 of that manual?
     
  10. anark10n

    anark10n Member

    I see, I thought it meant a vhost is what was needed in the case, so i guess that explains why the wordpress kept getting rewritten, but i'm still confused as to the other site not showing the correct subdomain, both main domain and subdomain for that one just have a simple html file inside their respective directories.
    Also, I'm guessing the DNS record for the wordpress subdomain would then be an A record and not a CNAME, but I'd like a confirmation as to whether my thinking is correct in this.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    A website and a vhost subdomain are technically both independent apache vhosts. So generally, you can use both, but you must ensure that when you are using a vhost subdomain, that you use a different directory for it, so do not point it to the main website. For security reasons, it is better to use a website, so I'll recommend you to not use vhost subdomains but use separate websites instead.
     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    This does not matter. Either way is good in this case.
    My guess is ISPConfig works as intended, but the configuration you have made does not do what you want.
     
  13. anark10n

    anark10n Member

    Everything appears resolved for the moment. Thanks for the assistance
     

Share This Page