Httpd-vhost.conf issues (XAMPP)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Httpd-vhost.conf issues (XAMPP)

Postby Threepwud » 14. March 2010 01:55

Hey peeps and thanks for such an amazing opportunity to port my little community into this world!

I've been using one domain for some time now, very well (since 2006 with a very modest 10-15 active users) and I have recently tried to expand a little on my hosting.

I've successfully setup XAMPP for my Windows 7 server and configured the ftp/mail/apache/php modules seperately. However I've fancied tricking the setup into thinking it can handle multiple domains.

I have threepwud.com in my xampp/htdocs/ folder and threepwud.co.uk in xampp/htdocs/threepuk (with the intent eventually moving threepwud.com to xampp/htdocs/threepwud)

In the httpd-vhost.conf file I've edited in two extra domains to reflect this:
Code: Select all
<VirtualHost *:80>
   DocumentRoot "C:/xampp/htdocs"
   ServerName localhost
</VirtualHost>

<VirtualHost *:80>
   ServerName threepwud.co.uk
   ServerAdmin webmaster@localhost
   DocumentRoot "C:/xampp/htdocs/threepuk"
</VirtualHost>

<VirtualHost *:80>
   ServerName hldrfans.com
   ServerAdmin webmaster@localhost
   DocumentRoot "C:/xampp/htdocs/hldrfans"
</VirtualHost>


Threepwud.com automatically redirects to xampp/htdocs/ and threepwud.co.uk does indeed go to xampp/htdocs/threepuk but in threepwud.com (on the website) I have a link pointing to threepwud.co.uk and it simply loads up a threepwud.com index page. I've also added a third domain (hldrfans.com) and this too directs automaticallly to threepwud.com.
What could I be doing wrong? Why isn't the url link redirecting correctly?

Many thanks for ny help provided -
Stu
Threepwud
 
Posts: 3
Joined: 18. February 2010 23:01

Re: Httpd-vhost.conf issues (XAMPP)

Postby Threepwud » 14. March 2010 15:23

I have just discovered that if I link from threepwud.com to http://www.threepwud.co.uk then it goes back to threepwud.com but if I remove the WWW then it works. So http://threepwud.co.uk takes me to the correct .co.uk address.
Threepwud
 
Posts: 3
Joined: 18. February 2010 23:01

Re: Httpd-vhost.conf issues (XAMPP)

Postby CraigS » 15. March 2010 15:22

I think you're missing the www. catcher for the server. To get the server to listen to http://www.* you also need the 'ServerAlias' feature added to your config, as you can see below:

Code: Select all
<VirtualHost *:80>
   DocumentRoot "C:/xampp/htdocs"
   ServerName localhost
</VirtualHost>

<VirtualHost *:80>
   ServerName threepwud.co.uk
   ServerAlias www.threepwud.co.uk
   ServerAdmin webmaster@localhost
   DocumentRoot "C:/xampp/htdocs/threepuk"
</VirtualHost>

<VirtualHost *:80>
   ServerName hldrfans.com
   ServerAlias www.hldrfans.com
   ServerAdmin webmaster@localhost
   DocumentRoot "C:/xampp/htdocs/hldrfans"
</VirtualHost>
User avatar
CraigS
 
Posts: 16
Joined: 10. March 2010 23:37
Location: Wisconsin, USA

Re: Httpd-vhost.conf issues (XAMPP)

Postby parky » 19. March 2010 20:48

This doesnt work for me.
parky
 
Posts: 2
Joined: 19. March 2010 00:41


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 33 guests