473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Default file in subdirectories

i think it is user friendly to have a default file in each subdirectory.
However, i hate to have lots of index.html files. Instead i would like to
have a meaningful and unique file name for all my default files. Is there
any way to specify the default file name for a given subdirectory locally
(i.e. not on the server)?
Thanks for any answers.
Guenther

Jul 20 '05 #1
7 2266
On Thu, 6 Nov 2003 10:58:41 +0100, in comp.infosystems.www.authoring.html,
Günther Steinmetz wrote:
Is there
any way to specify the default file name for a given subdirectory locally
(i.e. not on the server)?


Not on the server ? On the client ???

if your webserver is apache, you can create a .htaccess file containing:
Directoryindex mypageiwant.html

--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
Jul 20 '05 #2
"Günther Steinmetz" <gs********@web.de> wrote:
i think it is user friendly to have a default file in each subdirectory. However, i hate to have lots of index.html files. Instead i would like to have a meaningful and unique file name for all my default files. Is there any way to specify the default file name for a given subdirectory locally (i.e. not on the server)?


Imagine you want to archive your website. After some years you have a
look at it on your hard drive. You won't find the entry point anymore.
Especially when there are a lot of html files. I hated the CSS
documentation e.g., because it's main file was named "content.html"
instead of "index.html". Therefore, I had to search for it when having
downloaded the docs.
Personally, I prefer creating meaningful folder names now and always
using "index.html" even if there's only one html file.
Just for consideration.

Andreas

--
Andreas
To reply via e-mail, please remove the fruit and the ".invalid" top
level domain from my address.
Jul 20 '05 #3
"Salagir" <Sa*****@jeruCITEDELESPACE.org.invalid> schrieb im Newsbeitrag
news:3f**********************@news.free.fr...
On Thu, 6 Nov 2003 10:58:41 +0100, in comp.infosystems.www.authoring.html,
Günther Steinmetz wrote:
Is there
any way to specify the default file name for a given subdirectory locally (i.e. not on the server)?


Not on the server ? On the client ???

if your webserver is apache, you can create a .htaccess file containing:
Directoryindex mypageiwant.html

Sorry for my stupid question. I was really not asking for something not
being on the server, but was looking for something i can control. Thanks for
your answer, it solves my problem. Of course now i need a .htaccess file in
each subdirectory, right?

Jul 20 '05 #4
Günther Steinmetz <gs********@web.de> wrote in news:bod63q$1d6k7c$1@ID-
67469.news.uni-berlin.de:
i think it is user friendly to have a default file in each subdirectory.
However, i hate to have lots of index.html files. Instead i would like to
have a meaningful and unique file name for all my default files. Is there
any way to specify the default file name for a given subdirectory locally
(i.e. not on the server)?
Thanks for any answers.
Guenther


If you are using Apache, you can add directives to your
..htaccess file(if they are supported by your server).
The simple thing is to specify Directoryindex, and that
will apply for the current directory and all subdirectories
(unless it is overridden).
It's not clear if you want a different index file name in
each subdirectory - if so, that would take more work.
You could also do something like use a custom error handler
to solve the problem - add ErrorDocument directive(s) to
..htacess that point to a script(e.g. PHP) that serves the
required index file for the directory when index.htm, index.html,
index.php, etc. is requested.

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics
Jul 20 '05 #5
In article <bo*************@ID-67469.news.uni-berlin.de> in
comp.infosystems.www.authoring.html, Günther Steinmetz
<gs********@web.de> wrote:
i think it is user friendly to have a default file in each subdirectory.
However, i hate to have lots of index.html files. Instead i would like to
have a meaningful and unique file name for all my default files. Is there
any way to specify the default file name for a given subdirectory locally
(i.e. not on the server)?


No. That is a logical impossibility.

What you mean by "default file" is what the server gives the user
when the user specifies a URL ending in a slash. (These are not
necessarily directory identifiers, but often are.) How would a
browser know what to ask for? It can't; it must depend on the
server.

Now, if you want to do it on the _server_ there is most likely a
command. Which command of course depends on which server, and when
you post your query to one of the comp.infosystems.www.servers.*
newsgroups you should specify that.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #6

"Günther Steinmetz" <gs********@web.de> wrote in message
news:bo*************@ID-67469.news.uni-berlin.de...
i think it is user friendly to have a default file in each subdirectory.
However, i hate to have lots of index.html files. Instead i would like to
have a meaningful and unique file name for all my default files. Is there
any way to specify the default file name for a given subdirectory locally
(i.e. not on the server)?


You can always use meaningful names for these pages, and then create files
called index.html that point to them. It is indeed easiest for future
maintenance purposes to know that, for any directory, you can find the entry
point in a file named index.html. (Or index.asp or default.jsp or whatever
you like, as long as it's consistent.)

Jul 20 '05 #7
On Thu, 6 Nov 2003 12:14:18 +0100, in comp.infosystems.www.authoring.html,
Günther Steinmetz wrote:
"Salagir" <Sa*****@jeruCITEDELESPACE.org.invalid> schrieb im Newsbeitrag
news:3f**********************@news.free.fr...
Directoryindex mypageiwant.html

it solves my problem. Of course now i need a .htaccess file in
each subdirectory, right?


Nope :)

The htaccess applies to the directory it's in and all its subdirectories,
except if they also have a htaccess.

--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
As a math atheist, I think I should be excused from this.
--- Calvin, to Hobbes
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lab309 | last post by:
The problem I'm trying to solve is as follows: The website has two subdirectories: /ordinary and /phpstuff. Users typing hostname/ordinary get the file index.htm by default, and this works fine. ...
5
by: Thomas Philips | last post by:
I want to get a list of all subdirectories of a given directory, and within each directory, change the name of each file using a predetermined rule. The function glob in module glob will give me...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
1
by: android | last post by:
<Directory xmlns="http://tempuri.org/test.xsd" name="root"> <file name="File1"></file> <file name="File2"></file> <Directory name="Dir1"> <file name="File1"></file> <file name="File2"></file>...
4
by: Andy | last post by:
Hi, We have an asp 1.1. app with a number of subdirectories, but still part of the same app. One of these directories is now to have a couple of plain html files in them, so I diligently look at...
4
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
Hi; It's there but I don't see anywhere that I actually tell my pages to include default.css from my theme? And how can I add a second css file from my theme to a specific page? -- thanks...
4
by: tasahmed | last post by:
Hello Friends, I wrote a function which scans the current working directory and lists out details such as directory/file owner, permission etc. The output of this script can be viewing in the...
1
by: w33d5 | last post by:
I'm looking for a little help in making an index file to read the subdirectories in the same folder and display the links in a table. i am loading photo galleries using google's picasa onto my...
10
by: beary | last post by:
Hello all, I've done something a bit stupid and am hoping some kind soul out there can help me out. There's a piece of code that goes through and creates a high number of subdirectories within...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.