I have been to a few websites where they have something like http://www.website.com/testpage/ and a page automatically loads up in the browser. The link does not point to a html but it still works. I tried the same and it listed the files in the directory so I am missing something. Can somebody explain what is missing here or how to get it to work ? Thank you.
Automatic loading of file in a folder
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
Page 1 of 1
Automatic loading of file in a folder
#2
Posted 25 April 2007 - 10:58 AM
The behavior you have described is rather simple to get going: When you create a link on a page, and it points to a directory, and not specifically a file...
Such as this: http://www.website.com/about/
yet, not this: http://www.website.c...t/filename.html
It will automatically look for a file name called one of the following:
- index.html
- index.htm
- index.php
- default.asp
etc.
So, in essence, you simply want the "home page" within each directory to be called one of the above examples (index.html assuming you're serving pure HTML files), and then make a link to
http://www.yourdomai.../yourdirectory/
Viola!
Such as this: http://www.website.com/about/
yet, not this: http://www.website.c...t/filename.html
It will automatically look for a file name called one of the following:
- index.html
- index.htm
- index.php
- default.asp
etc.
So, in essence, you simply want the "home page" within each directory to be called one of the above examples (index.html assuming you're serving pure HTML files), and then make a link to
http://www.yourdomai.../yourdirectory/
Viola!
#3
Posted 25 April 2007 - 11:54 AM
WoW ! I know you are gonna laugh reading my response but I did not think it was that simple. Thanks for the info Marc. I really appreciate your quick response.
This post has been edited by sam: 25 April 2007 - 11:54 AM
#4
Posted 25 April 2007 - 05:32 PM
Just bear in mind that depending on your hosting, the priority of which file will become the index file for a folder could change! Contact your host for more information if you're not sure, or simply play around with different file names to see what happens.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
#6
Posted 10 May 2007 - 11:42 PM
Its also possible to do it with htaccess. but using index.html is much simpler
but if you want to get to /folder/file.swf to be the index where all you need is /folder put
in the htaccess file.
but if you want to get to /folder/file.swf to be the index where all you need is /folder put
DirectoryIndex file.swf
in the htaccess file.
Share this topic:
Page 1 of 1


Help
This topic is locked
MultiQuote











