LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Virtual Host Redirect Issue (http://www.linuxquestions.org/questions/linux-software-2/virtual-host-redirect-issue-107635/)

DigiDave 10-23-2003 01:06 PM

Virtual Host Redirect Issue
 
This is probably a simple question but to simple for me to answer and therefore require some help.

I have set up two virtual hosts will success however when I type the URL into the browser for one I get the other But only when I type the URL in the following way.

eg: type into browser www.mydomain2.ca and you get www.mydomain1.com any the index page for my first virtual server.

type into browser mydomain2.ca you get www.mydomain2.ca the proper index page. Puzzling!!!

I know why it's happening (I think?) I has to do with the pointing but I can't figure out how to adjust Apache to correct.

Any suggestions would be appreciated. I hope to have enough experience with all of this to someday help others.

:newbie:

schwing 10-23-2003 02:40 PM

In your VirtualHost directive, check to see if you have ServerName AND ServerAlias set correctly. I use a format like:

<VirtualHost 192.168.0.10>
DocumentRoot "/usr/local/apache/htdocs/mydomain"
ServerName www.mydomain.com
ServerAlias mydomain.com
</VirtualHost>

Then don't forget to restart Apache.

HTH.


All times are GMT -5. The time now is 04:44 PM.