I have problem with ServerAlias directive. Configuration looks like this:
ServerName d.geosurf.ru
ServerAlias www.d.geosurf.ru divo32pro.ru www.divo32pro.ru
But! Everytime when I try to go to divo32pro.ru, for example, i get d.geosurf.ru (servername). It seems like there's no redirect, but something wrong... Any ideas?..
ServerAlias
simply declares alternative names that can be used to address the same site (or <VirtualHost>
. So if I have
ServerName www.example.com
ServerAlias example.com
I will see the same content for both http://www.example.com/foo/
and http://example.com/foo/
.
However, if the Apache server needs to issue a redirect for any reason (for example from a directory name without a trailing slash to the corresponding name with the slash), the behaviour depends on the UseCanonicalName setting. If this is unspecified or Off
then it will do what you would expect (http://example.com/foo
-> http://example.com/foo/
) but if it is set to On
then the redirect will be to the ServerName
regardless of the original request URL (i.e. http://example.com/foo
-> http://www.example.com/foo/
). Check if you have this set in your configuration.
ServerAlias
doesn't redirect you to the new site.
ServerName
just says "here is my server name" and ServerAlias
says if anyone goes to X Y or Z then please treat them as if they came direct to ServerName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With