Prefix on vhost document root

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Prefix on vhost document root

Postby supernovi » 14. November 2014 11:47

Hi

I'm hoping someone can help me.

I've installed XAMPP and followed this simple guide to setting up vhosts http://jonathannicol.com/blog/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/ however my vhost reports as 404. I've been trying everything I can think of and last night started checking the error log for apache when I see it complaining about a none existing directory, here I can see the directory is '/Applications/XAMPP/xamppfiles/htdocs/<someweirdstring>/Applications/XAMPP/xamppfiles/htdocs/base' however all I put in my vhost was '/Applications/XAMPP/xamppfiles/htdocs/base' clearly something is adding a prefix to the directory string.

Can someone explain why it's doing this? It obviously won't work as that directory doesn't exist.

Thanks in advance.
supernovi
 
Posts: 2
Joined: 14. November 2014 11:39
Operating System: OSX Yosemite

Re: Prefix on vhost document root

Postby Nobbie » 14. November 2014 12:53

supernovi wrote:clearly something is adding a prefix to the directory string.


This "something" ought to be a previously installed software (WordPress, Joomla or whatever), which puts a .htaccess file into your htdocs and may do some redirections. And it does not expect a "base" subfolder in that context. Thats what i believe what happens.

Anyway, it is never a good idea to run a VirtualHost in a subdirectory of the DocumentRoot (i.e. the htdocs folder). Put the the VirtualHost to the same level as the htdocs folder (at least), so they cannot collide. For example, use /Applications/XAMPP/xamppfiles/base instead of /Applications/XAMPP/xamppfiles/htdocs/base. Or /Applications/XAMPP/xamppfiles/VirtualHosts/base (so you can easily see, which VirtualHosts you have on your system).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Prefix on vhost document root

Postby supernovi » 14. November 2014 13:48

There is no software installed, I've just put a dummy index.php in there that output 'Hello world'. It's something to do with the apache conf I'm sure. I just don't know where it is.

The dir ideally would be somewhere else like you suggest, I just know for sure it works at that location (permissions etc) as the xampp default site works fine. I'll move it once I've figured out the above.
supernovi
 
Posts: 2
Joined: 14. November 2014 11:39
Operating System: OSX Yosemite

Re: Prefix on vhost document root

Postby Altrea » 14. November 2014 14:11

show us your Apache config, your vhost config and tell us what "<someweirdstring>" means.
Without detailed information it is not possible to provide specific help
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 9 guests