: Domain Alias with forward in plesk I need to create a domain alias alias.domain.com to forward http to www.domain.com. It has to be a forward and not a redirect (I was told it can be done
I need to create a domain alias alias.domain.com to forward http to domain.com.
It has to be a forward and not a redirect (I was told it can be done by creating CNAME).
Note I am using Plesk and creating a domain alias in plesk creates an A record not a CNAME.
Any thoughts please?
More posts by @Tiffany637
2 Comments
Sorted by latest first Latest Oldest Best
Consider...
bar.example.com. CNAME foo.example.com.
foo.example.com. A 192.0.2.23
Here,
when a DNS resolver encounters a CNAME record while looking for a regular resource record, it will restart the query using the canonical name instead of the original name.
That is when an A record lookup for bar.example.com is done, the resolver will see a CNAME record and restart the checking at foo.example.com and will then return 192.0.2.23.
In Plesk, when we create a domain alias, actually it adds ServerAlias alias.domain.com in vhost configurations of httpd, and hence the A record. Read Here and try relating with this.
As a matter of fact alias.domain.com is resolving directly to pointing IP address, restarting of query is not required is in CNAME.
There is no difference between a forward and a redirect. What you mean is probably the function called "Redirection" in Plesk and that function needs to be enabled by your host to show up. If it's not there, ask your hoster to enable it for you.
If Plesk (or your hoster) doesn't help you out, you may need to add this to your root-folder's .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} !^alias.domain.com$ [NC]
RewriteRule ^(.*)$ www.domain.com/ [R=301,QSA,L]
</IfModule>
If your host gives you 500 error, remove the hash from the third line. That ought to do it.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.