Jump to content

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
  • You cannot start a new topic
  • This topic is locked

Automatic loading of file in a folder Rate Topic: -----

#1 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 25 April 2007 - 10:27 AM

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.
0

#2 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

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!
0

#3 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

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

0

#4 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

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
0

#5 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 26 April 2007 - 10:01 AM

Thanks Sirkent.
0

#6 User is offline   BigMike Sidelka 

  • W.R. Sergeant
  • Group: Members
  • Posts: 241
  • Joined: 31-July 06
  • Gender:Male
  • Location:C-Town, Ohio

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

DirectoryIndex file.swf


in the htaccess file.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users