Skip to main content

Domain Alias force redirect

Comments

4 comments

  • cPanelLauren
    Hello, Aliases are essentially created for a domain that's going to display the contents of another domain. Meaning it's not going to do what a wildcard redirect will do (i.e., redirect domain.tld/folder to sourcedomain.tld/folder) If your domain is at domain.tld/folder and you want to alias it to domain.tld you would have to add a redirect for it to work. What is it about redirects that you're not wanting to use?
    0
  • eitanc
    I know what is an alias, but why can't I set it to show the content of 1 level sub-folder of the public_html root folder? I try to make the alias domain pre-loaded in the HSTS list, at
    0
  • cPanelLauren
    You can't do this because you can't create an alias of domain.tld/folder - aliases are of the domain not the domain + directory this won't work when added to the VirtualHost You can read about what a ServerAlias is and how they work here: core - Apache HTTP Server Version 2.4 When you submit a domain for HSTS preload you must include a redirect from http to https and an HSTS header so excluding the redirect would not serve your purpose.
    0
  • eitanc
    OK, I looked into this - and all you needed was to advise me to use an "addon domain" instead of alias to solve this, as this solved the issue since it allows me to set a public own/self domain to use specific existing sub-folder of public_html. BTW, I think there is a typo at Redirects | cPanel & WHM Documentation - at step 3 "directory.file.html" should be "directory/file.html"
    0

Please sign in to leave a comment.