Page 1 of 1

Clarification of Placement of test website index/home page

PostPosted: 01. March 2012 14:38
by StuartStein
I have followed he instructions of Andy Harris in his HTML, XHTML & CSS for Dummies (that's me), and changed the names of the php and html files in the htdocs folder from their original. I then pasted into that folder a page with the filename Index.htm.

According to Harris, when the URL localhost is entered after this, this should bring up the Index page-but it does not. Instead, as you probably all know, http://local host resolves to localhost/xampp. When I use the URLs localhost/index.htm and localhost I receive the message: 'The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.' Strangely, the <title> of the page appears in the Tab information. When I use the URLs localhost/xampp/index.htm and localhost/xampp/htdocs/index.htm I get the same message but without the <title> in the Tab information. Obviously I am doing something wrong.

I downloaded the zip version and it was installed on G:\xampp on a Windows VIsta Business 64 bit operating system.

Any help is appreciated and sorry about the elementary nature of the query.

Stuart Stein

Re: Clarification of Placement of test website index/home pa

PostPosted: 01. March 2012 15:43
by JonB
I suggest you read the chapter(s) on Apache. If there are no chapters on that subject, find a book that does include them. There is Zero point in learning HTML, XHTML and CSS if you don't know how servers work. Its rather like learn how to build an automobile but not knowing about highways, rules of the road and maps. :mrgreen:

All webs servers (Apache, IIS and the rest) have directives or configuration options to tell the server what page(s) to serve, and in what order, when a Folder address (URL) is used rather than a Page URL. ... ctoryindex

Code: Select all
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
<IfModule dir_module>
    DirectoryIndex index.php index.cgi index.asp index.shtml index.html index.htm \
                   default.php default.cgi default.asp default.shtml default.html default.htm \
                   home.php home.cgi home.asp home.shtml home.html home.htm

Most Apache Directives are found in the Apache .conf files in \xampp\apache\conf and \xampp\apache\conf\extra. That entry is in the main file - \xampp\apache\conf\httpd.conf . Many directives can also be placed in .htaccess files, a very common practice that lets you 'fine grain' your controls.

bookmark that Apache Docs page, it will be invaluable.

Good Luck

Re: Clarification of Placement of test website index/home pa

PostPosted: 01. March 2012 16:14
by StuartStein
Whilst I appreciate your taking the time to reply, I do not appreciate your extreme arrogance, manifested in the posting of a green smiley, and comments about Zero points on HTML, XHTML and CSS, car mechanics and road routes. I know of no connection between the ability to write html and knowing where to place an index page on an Apache server; I have been writing html, etc. pages probably long before you ever got your hands on a playstation, as well as navigating around the world using mechanical road devices. I have absolutely no desire to become an expert on Apache or other servers, which no doubt for someone who has posted 2000+ messages in this forum must be galling; I just want to use it temporarily as a test bed. All I asked for was the answer to a very simple question: where does the index page/root directory for a website go, and I don't need a dressing down megillah in reply. I followed the instructions of someone who implied that they knew what they were talking about, and when this did not work, I asked for some clarification. Obviously this forum is different from many others.

Re: Clarification of Placement of test website index/home pa

PostPosted: 01. March 2012 17:53
by hackattack142
1. It depends on what you are trying to accomplish. Through the various configuration files and mechanisms like vhosts, it could really be placed anywhere as long as the configuration is adjusted accordingly. The default document root is /xampp/htdocs
2. By default, if you access http://localhost, the index.php in the /xampp/htdoc folder will be used and will redirect it to the http://localhost/xampp. Moving or renaming that file should stop the automatic redirection
3. By default, you should be able to access http://localhost/index.html and get a page that says "It Works!"

If accessing the default index.html file at http://localhost/index.html works, i would double check your custom HTML file for errors.

Re: Clarification of Placement of test website index/home pa

PostPosted: 01. March 2012 19:34
by StuartStein
Thanks to hackattack 142 for your reply.