How to add an alias to subdomain?

Follow

Comments

8 comments

  • Avatar
    Unknown User (Edited )

    I solved this problem through "Apache & nginx Settings" of my subdomain

    Additional directives for HTTP:
    ServerAlias my.alias.subdomain.tld
    Additional directives for HTTPS:
    ServerAlias my.alias.subdomain.tld
    Additional nginx directives:
    server_name my.alias.subdomain.tld;

    Just make sure your alias subdomain resolves correctly to the same IP as your base subdomain you want to stick your alias to.

  • Avatar
    Ivan Postnikov (Edited )

    Hello @Sage, thank you for sharing an alternative way to achieve this goal.

    Have you tried the steps from the article? Why was this way not suitable for you?

    Thank you in advance.

  • Avatar
    Unknown User

    Hello, @Ivan,

    Article offers redirect, redirect is not alias, it's just a redirect which sends browser to another location.

    Alias is fully-functional another name that points to same virtual host of webserver which is visible under it's own name, not under base subdomain name (they could belong to different domains at all).

    In my case, IP from DNS record became inaccessible (it pointed at old load balancer which IP became unavailable) and I created temporary address that users could use until their cached DNS completely change to point to new address. But not to bother with different DocumentRoot trees i just made it alias of another (temporary inaccessible for some users) subdomain. Yes, probably it's square-wheeled bicycle solution, but at least it works.

  • Avatar
    Anzhelika Khapaknysh

    Hi @Sage!

    The article has been updated according to your recommendations.
    Thanks for taking part in improving our knowledge base!

  • Avatar
    Andrew Sassoye

    Hello,

    This solution is really great. But how do I have to make Let's Encrypt also register the alias in the certificate?

    Thank you in advance.

  • Avatar
    Unknown User

    Can anybody pleaaaaase, explain this workaround better ...?

  • Avatar
    Konstantin Annikov

    @Mohamed Kheddime

    I have added a screenshot of Apache additional directives screen. Hope this helps to apply the workaround.
    If you are a domain owner and Apache/nginx additional directives are hidden, it is needed to contact your service provider for assistance.

    Reply me if something else should be added to describe the workaround in a best way.

Please sign in to leave a comment.

Have more questions? Submit a request