Multiple sites on server: The www version redirect to another domain


I have multiple sites together on the same server,

Each domain have the DNS with a records with "@" and "www" and still when I tried to surf to the www version, like -> I redirected to other site on the same server (usually the last one added to the server).

Why is this happening and what do I need to do, please?

Thank you


  • edited September 2019

    @rebornYour DNS is fine.

    But you need to configure your webserver to recognise the "www" address.

    It sounds like you are setting up each site as <host>blah blah</host> (the config. syntax will depend on which web server software you are using)

    but you don't have a match for <host> - these are completely different sites as far as everything is concerned.

    So, the server keeps looking through it's config for a site-match, and as it doesn't find one, it just uses the last one it read in - i.e. the last site configured in the config file.

    3 ways to fix this (again, the exact command/syntax depends upon the server software):

    1) Configure a site section for as a seperate site. You presumably don't want to do this!

    2) Add an address alias in <host> .... serveralias

    • this will allow both addresses to work, and exist in parallel.

    3) Create a redirect rule, "adding in" or removing the "www" bit depending on if you want or to be the main site. This means both address forms will work, but if the unpreferred form is used, it will automatically be converted to the new form. This is the best solution - for one thing it means your site won't be indexed at 2 seperate addresses.

    Anyway, the important question... What websoftware are you using?

Sign In or Register to comment.