access site locally with the www intact - Solved

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

access site locally with the www intact - Solved

Postby WebWeaver64 » 20. August 2011 21:39

I've tried searching for this, but I think because www is only three characters I can't find anything.

I've finally go XAMPP running on Windows 7 with access from both the XAMPP machine and my laptop, however I can't figure out how to be able to use http://www.mysite.loc. I can use mysite.loc but I can't get to the "home" page because it always converts to http://www.mysite.loc.

I've tried both
127.0.0.1 http://www.mysite.loc
&
127.0.0.1 mysite.loc

In my httpd-vhosts.conf file I have
<VirtualHost http://www.mysite.loc:80>
DocumentRoot "/localsites/mysite"
ServerName http://www.mysite.loc
ServerAlias mysite.loc *.mysite.loc
</VirtualHost>

If I remove all the www, I can access mysite.loc/wp-admin but I can goto mysite.loc.

Any help would really be appreciated, I've been mucking about trying to get this working for at least 2 weeks on Windows 7, and it's just been one issue after the other. :shock:
Last edited by WebWeaver64 on 21. August 2011 00:48, edited 1 time in total.
WebWeaver64
 
Posts: 3
Joined: 29. December 2008 19:28

Re: access site locally with the www intact

Postby WebWeaver64 » 21. August 2011 00:47

I finally was able to work this out, so I'm posting my own answer.
In httpd-vhosts.conf I added the below towards the top above the NameVirtualHost (line 15) I'm not sure if it's needed but I'm not taking it out now that everything is working.

<Directory S:/localsites>
Options All
AllowOverride All
Order Deny,Allow
Allow from All
</Directory>

I then put in 2 VirtualHost instructions one with www and one without.

<VirtualHost www.mysite.loc:80>
DocumentRoot "/localsites/mysite"
ServerName www.mysite.loc
ServerAlias www.mysite.loc
ErrorLog "/xampp/apache/logs/mysite-error.log"
CustomLog "/xampp/apache/logs/mysite-access.log" common
</VirtualHost>

<VirtualHost mysite.loc:80>
DocumentRoot "/localsites/mysite"
ServerName mysite.loc
ServerAlias mysite.loc
ErrorLog "/xampp/apache/logs/mysite-error.log"
CustomLog "/xampp/apache/logs/mysite-access.log" common
</VirtualHost>

In the hosts file I added again one for each
127.0.0.1 mysite.loc
127.0.0.1 www.mysite.loc

And I was able to access it with either. It did rename the www.mysites.loc to mysites.loc but who cares it's working!!!
WebWeaver64
 
Posts: 3
Joined: 29. December 2008 19:28


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 70 guests