Vhosts - paths problem

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

Vhosts - paths problem

Postby scathlock » 07. February 2010 17:20

I have XAMPP 1.6.8. I tried to set up a vhost because I don't want to keep my projects in htdocs. The schema of httpd-vhosts.conf is below:

Code: Select all

DocumentRoot C:\xampp\htdocs
ServerName localhost
ServerAlias localhost www.localhost

DocumentRoot D:\projects\prj1
ServerName prj1.localhost
ServerAlias prj1.localhost www.prj1.localhost
DirectoryIndex index.php
<Directory D:\projects\prj1>
    AllowOverride All
    Allow from All

The problem is that browser can't find images and css because of paths - links are broken. They look like http://prj1.localhost\/forum.php or http://prj1.localhost\/img/pic.gif. When I delete the backslash links are OK.
Could You help me with this problem?
Posts: 4
Joined: 07. February 2010 17:10

Re: Vhosts - paths problem

Postby LooseCannon » 08. February 2010 10:49

I think that the slashes in httpd-vhosts.conf should all be forwards, not backwards.

Blame Bill Gates for backslashes? ;)
User avatar
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Re: Vhosts - paths problem

Postby scathlock » 08. February 2010 14:37

Slashes or backslashes - there's no difference - it is not working correctly.

One more thing: I have two project and one of them (in pure php) doesn't work, but the other one in php framework works correctly.

The problem occurs only in Firefox and Opera. IE and Chrome are OK...
What can I do to get things work under ff and opera?
Posts: 4
Joined: 07. February 2010 17:10

Re: Vhosts - paths problem

Postby cthackers » 03. March 2010 20:41

i think it has nothing to do with the virtual hosts but with the way you load the files in the project (the src="" tags).
Posts: 14
Joined: 03. March 2010 20:06

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 42 guests