VirtualHost Problem! 2 domains pointing to same directory!
I have 2 domains and I setup a 2 Virual Host entries in my http.conf file.
NameVirtualHost 64.62.190.109:80
<virtualhost 64.62.190.109:80="">ServerName www.reelanglers.net
ServerAlias reelanglers.net
DocumentRoot "/var/www/html"
DirectoryIndex index.html</virtualhost>
<virtualhost 64.62.190.109:80="">ServerName www.rodvictoria.net
ServerAlias rodvictoria.net
DocumentRoot "/var/www/html/blog/wordpress"
DirectoryIndex index.php</virtualhost>
It's frustrating because it looks like I have everything configured right, but when I try to go to my new domain it points to my fishing site.
I have restarted httpd after making these changes.
The other strange thing is that it redirects to the reelanglers site when trying to go to the rodvictoria site.
Strange!
5 Replies
aside from that your config matches might fairly close and I post 3 sites of the same node/ip address.
<virtualhost *="">ServerName killboard.eve-razor.com
ServerAlias killboard.eve-razor.com
DocumentRoot /var/www/killboard</virtualhost>
<virtualhost *="">ServerName membertracker.eve-razor.com
ServerAlias membertracker.eve-razor.com
DocumentRoot /var/www/membertrack</virtualhost>
make sure you DNS is pointing to the server for both domains ofc.
I don't think that's an Apache issue. I'd suggest checking the wordpress configuration at the rodvictoria.net site.
-- I'd put them in separate directories regardless, as per MrRx7.
This can happen if something is amiss in your .htaccess file, or else you'll need to find out which URL your Wordpress installation thinks it's on. Wordpress has the nasty habit of remembering the URL where it was first installed. It behaves strangely when you move the files afterwards.
Use something like phpMyAdmin to open the Wordpress database.
Open the "wp_options" table.
Find "siteurl" (option id: 1) and "home" (option id: 39 on second page).
Both of them should be
And as mjrich said, you probably want to put the two domains in separate directories even if Apache doesn't complain about it. Right now, one of your sites is accessible also as a subdirectory of another site. This will probably hurt your search engine ranking.
I moved the directory and also edited the database and it is now working properly!
Thanks So Much!!!