xampp does not see my index.html

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

xampp does not see my index.html

Postby johnw » 13. October 2007 01:06

ok,

i have xammp installed and did it smoothless....
as the tutorial says......

Question 2: Where should I place my web content?
The main folder for all WWW documents is at \xampp\htdocs. If you put a test.html file here you can browse for it at http://localhost/test.html (if Apache server is running). Use the same procedure with all PHP or cgi files. You can create subfolders for your content too. For example, create the folder \xampp\htdocs\new and copy your test.html file there. Then enter the URL http://localhost/new/test.html to view this in your browser.


that should be clear but all i get is object not found.....
so i have a directory structure like :http://localhost/xampp/htdocs/index.html
and that should work,but no index.html file shows...

What am i doing wrong?
All i did was install it by installer,and as last...before i shut it down again i tok care of the security..
Last edited by johnw on 13. October 2007 02:25, edited 1 time in total.
johnw
 
Posts: 16
Joined: 11. October 2007 21:20

Postby Izzy » 13. October 2007 01:24

I am pleased you had no problems installing XAMPP which shows that it still works 'out of the box' so to speak.

If you look in the htdocs directory you will see an index.php file which should be either renamed or deleted to get your index.html working as the default page.

Also there is no need to include the xampp or htdocs in the address:
http://localhost/index.html
should bring up the index page for you.

Alternatively create another directory in the htdocs tree and put your site's files in it so you would call it like this:
http://localhost/mysite/index.html

After these changes and to get the XAMPP Welcome page you would now call it using this address:
http://localhost/xampp/

As you can see if there is only one index page in a directory then there is no need to use it in the address bar.
http://localhost/ will do.

BTW you can edit your post's subject line if you wish as I believe it should be "xampp does not see my index.html" :wink:
HTH


===========================================
Take a look at the new DeskTopXampp launch control for XAMPP
and XAMPPlite (DTX.exe) posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967
Available at Ridgewood's new DTX web site http://zedfiles.com/DTX/
Also available here: http://nat32.com/dtx/
I highly recommend DTX.
============================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby johnw » 13. October 2007 02:28

Thanks izzy,indeed your right...
i edited the topic title..

well i havent tried it yet as i was on my way to get some sleep,but if it was the index.php then it was my mistake...
but let me ask you,under normal server enviroments wouldnt the .html show before the .php as standard ?
anyway,ill post back in the morning..thank you
johnw
 
Posts: 16
Joined: 11. October 2007 21:20

Postby Izzy » 13. October 2007 04:09

Sleep! what's that? :wink:

johnw wrote:...well i havent tried it yet as i was on my way to get some sleep,but if it was the index.php then it was my mistake...
but let me ask you,under normal server enviroments wouldnt the .html show before the .php as standard ?
anyway,ill post back in the morning..thank you

It was not the index.php at fault if you included index.html in the address bar but rather the incorrect address in the first place.
http://localhost/xampp/htdocs/index.html
should have been
http://localhost/index.html

http://localhost/index.php = C:\xampp\htdocs\index.php (your path here and index.php until you change it - see below)
or just
http://localhost/ will give you the same page.

Rename the index.php to index.php.bak and place your index.html in C:\xampp\htdocs and now the address becomes:
http://localhost/index.html = C:\xampp\htdocs\index.html
or just
http://localhost/ will give the same default index page



Now the order that the server picks up the index file in a directory is determined in:
xampp\apache\conf\httpd.conf

Open this file in your favorite text editor (notepad for example - I use NotTab Pro - not wordpad or any other MS Word type of editor).

Look for line about 235 in the httpd.conf file:
Code: Select all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>
(The above order may not be the default as I may have changed mine at some time or other. Also, the slash /, at the end of an address http://localhost/, Apache interprets as a directory request).

As you can see it is possible to change the order of these index files to suit your needs and also to be able to add or delete when needed.

Apache will look for the first index file in a directory in the order they are in the above list.

So if there is an index.php then Apache will load it, if not Apache will load the index.php4 if it finds it and so on.

And in your case if Apache finds the index.php first it will be loaded before the index.html.

If there is only an index.html in the above list then Apache will load it, if that index.html file is in a directory.

TIP, All directories should have an index file even if that index file is blank as this technique prevents 'directory snooping' and can be deemed to enhance your web site security.

Keeping the original list intact and knowing how Apache works that list, should present no problems for you in the future.

TIP, If you change it and put the index.html first then there would be no need to rename the index.php as Apache would ignore it and load the index.html because the index.html now comes before the index.php in your edited list.

BTW, if you will never use any of the above except index.php and/or index.html then it would be fairly safe to delete the rest but as I always stipulate you should make a back up of any configuration file before making any changes.

You will then have your original working copy to fall back on if you make a syntax error (typo).

Save the configuration file and then always restart Apache to have those changes take effect.

I hope this will help clear up this issue for you and for others who may stumble upon this thread.
:)


===========================================
Take a look at the new DeskTopXampp launch control for XAMPP
and XAMPPlite (DTX.exe) posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967
Available at Ridgewood's new DTX web site http://zedfiles.com/DTX/
Also available here: http://nat32.com/dtx/
I highly recommend DTX.
============================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby johnw » 13. October 2007 16:11

that was indeed clear and all works as suggested...
my first step is to make a database..
see how well that goes :lol:
johnw
 
Posts: 16
Joined: 11. October 2007 21:20


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 140 guests