Localhost doesn’t find all files in Sites-Folder

apachewebsites

I have a strange problem:

I installed XAMPP long time ago and created a folder with an index.php file in my sites folder. When i start XAMPP and go to the browser localhost/~username i can see the folder-structure.

I click on the folder i created some month ago, and safari shows me
the index.php file.

But now i create a new folder, with a new index-file in it, and
navigate to it, i'm getting an 404 Error.

Both folders are in the same Directory: ~/Sites

  1. Open localhost/~username and i can see all folders in the ~/Sites – Folder
  2. Clicking on the folder created long time ago: works
  3. Clicking on the new folder created few seconds ago: Error 404

I think there is a problem in the apache-config file, but i do not understand why apache finds only the new file.

enter image description here

Best Answer

Ok, i don't know why but i changed the Document-Root-Folder in the XAMPP-Config-File to match /username/Sites.

Now the other folders work, too.

I don't understand why one folder works with the old configuration, and newer ones don't.

To all with the same problem:

The XAMP-Config-File must be the same document-root as the /etc/apache2 - config file on the mac

Strange thing, on my other Mac the Document-Paths are different but work.