Domain Alias force redirect
Hello,
I wish to have a domain alias for an already running site that use other domain name.
Say, I wish that domain2.com will be an alias for domain1.com.
I wish to avoid redirects as much as possible - so I went with the alias feature and not the redirect feature.
But, the alias feature only selects the root of my public_html directory, while the site is at public_html/domain1 folder and in the cPanel GUI I cannot set it to be so, so the cPanel GUI force me to do a redirect for the alias for things to work - and so we ended up using a redirect...
Is there a way to simply select the needed sub-directory for the alias and so not use a redirect?
Thanks!
-
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 -
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 -
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.
Comments
4 comments