Alias domain redirect doesn't work

Discussion in 'Installation/Configuration' started by Magiodev, Mar 31, 2019.

  1. Magiodev

    Magiodev New Member

    Hi guys,
    I have a server built following the Perfect Server on Debian 9, with Apache2.

    I've set a domain for mydomain.com (the main domain) and created an alias domain for the .es that i want as redirect 301.

    The result is that alias domain is working, with SSL too but as CNAME record, i mean that it's navigable as the .com domain.

    DNS setting for the .es is an A record on @ pointing to the IP and a CNAME on www pointing to @.

    I've tried on ISPConfig any kind of configuration, i mean to set No redirect, R, R,L and 301,RL but none of those worked.

    Thanks!
     
    Last edited: Mar 31, 2019
  2. Jesse Norell

    Jesse Norell Well-Known Member

    I just tested this same config, and adding an alias domain without a redirect set simply adds a ServerAlias line to the vhost file for the alias domain name, and http requests serve the page without changing the url; I then changed the redirect type to R=301,L and specified the main domain url as the Redirect path and a request to the alias domain name returns a 301 redirect; I then left the 301 redirect type but cleared the redirect path field and it went back to serving the site without a redirect. I'll guess you didn't fill out Redirect path?
     
  3. Magiodev

    Magiodev New Member

    No i didn't, i read on the documentation to let it empty and just set No redirect. So I've understood that setting R,301 might works and solve the problem.

    So if i have domain.com and domain.es (when both www. redirect to @ using CNAME records) what should i set in order to redirects .es domain to .com with a 301 redirect?

    Thanks! :)
     
  4. thed0g

    thed0g New Member

    To dig out this old question, I'm looking for the same answer: how do I set an alias domain, so that the actual URL in the browser also gets rewritten?

    Domain set as a site: a.com
    Aliasdomain: b.com

    Settings for the Aliasdomain: I've set redirect type to permanent, auto-subdomain to www and seo redirect to domain to www domain (I want the site to be redirected to www).

    Config on pastebin of nginx vhost generated by ispconfig:
    YdAfUgRZ

    Nothing in the .vhost config indicated that the URL should be rewritten, is it even possible?
     
    Last edited: Jun 22, 2019
  5. thed0g

    thed0g New Member

Share This Page