Page 1 of 1

htdocs and paths

PostPosted: 24. July 2006 01:35
by jakeyg

I am having trouble understanding how xampp works. I have copied a directory of work, called ss, into the c:\program files\xampp\htdocs\ dir, however when i point my browser to http://localhost/ss/ it says file not found. I cant understand why this is happening?


PostPosted: 24. July 2006 01:55
by Izzy
You need to specify an actual file name.
or put an index.html in the ss directory.

When you type http://localhost/ss/ into your address bar of your browser Apache is looking for an index file. It will give you a 404 file not found error if it is missing. You can also specify a file to load by using the name of one of the files in the ss directory.

This is the entry in the xampp\apache\conf\httpd.conf file that relates to the index files that Apache looks for to serve using just a directory like http://localhost/ss/

Code: Select all
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the
# same purpose, but it is much slower.
DirectoryIndex index.html index.htm index.php index.php4 index.php3 index.cgi index.html.var index.phtml

So create and put one of those files in your ss directory and it will work for you.

You can add an index file of your choice to the httpd.conf file if you prefer another file name eg. index.txt or myfileindex.extension etc.

Remember to restart Apache if you make any changes to the httpd.conf file otherwise Apache won't be aware of your changes.
HTH :)


PostPosted: 24. July 2006 02:59
by jakeyg
Hi Izzy

thanks for the response. Sorry i should have mentioned that the file is index.php. I also created a file called index.html just as a tester. I cant understand why i get a 404 on both of these. The standard xampp page comes up and everything is setup correctly, its just your standard out of the box config with no alteration. Anything else i might be able to try??


PostPosted: 24. July 2006 03:24
by Izzy
I just created a directory ss in the htdocs directory just like you did and included an index.html file then typed http://localhost/ss/ in my browser and it worked fine.

Perhaps you could try deleting your browser's cache and setting it to check the pages on every visit whilst you are doing site development work.

Also type the index.html or index.php in the address bar:
and see what it does.

Not much left to check if you have checked the httpd.conf file is correct.

As a last resort you may try and completely uninstall XAMPP and reinstall it clean again, maybe to a different location.

Hopefully it is just your cache returning the error page each time. :)