amazon ec2 - Apache ServerAlias not redirecting to correct ServerName -


i'm try setup multiple wordpress sites on amazon ec2 instance. here's how httpd.conf file looks like:

<virtualhost *:80>    servername www.domain1.com    serveralias domain1.com    documentroot /var/www/html/domain1 </virtualhost>  <virtualhost *:80>    servername www.domain2.co    serveralias domain2.co    documentroot /var/www/html/domain2 </virtualhost> 

so, when entered domain1.com or www.domain1.com in browser, redirects correctly content wanted , www.domain2.co . however, when entered domain2.co, doesn't directs servername www.domain2.co first virtualhost settings www.domain1.com.

anything i'm missing out here?

try this. apache default 1st virtual host if doesn't find virtualhost match means second virtualhost being ignored. use www. alias , domain server name. see if helps.

<virtualhost *:80>    servername domain1.com    serveralias www.domain1.com    documentroot /var/www/html/domain1 </virtualhost>  <virtualhost *:80>    servername domain2.com    serveralias www.domain2.com    documentroot /var/www/html/domain2 </virtualhost> 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -