/    Sign up×
Community /Pin to ProfileBookmark

Apache directories

Hi there,
Does anyone know how to tell Apache what file to use as the default page for a certain directory, like it knows to use index.html when you to the sites demain?

Thanks

Ninko

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@abzNov 25.2006 — what is wrong with using index.html?
Copy linkTweet thisAlerts:
@NinkoauthorNov 25.2006 — Well if I'm using 'index.html' in every directory I stand a chance of getting files mixed up and overwriting the wrong file etc etc lol.


Ninko
Copy linkTweet thisAlerts:
@abzNov 25.2006 — hmm...well I guess that could happen. How do you organise your files? Do you use a wysiwig or text editor or what? How similar are your pages that you might mistake them for each other?
Copy linkTweet thisAlerts:
@FangNov 25.2006 — [URL=http://httpd.apache.org/docs/1.3/mod/mod_dir.html]DirectoryIndex[/URL]
Copy linkTweet thisAlerts:
@NinkoauthorNov 25.2006 — Not sure I understand that doc Fang lol. Could you give an example?

Thanks


Ninko
Copy linkTweet thisAlerts:
@FangNov 25.2006 — In the directory you wish to open with 'myfile.html', create a file named '.htaccess'

In this file write 'DirectoryIndex myfile.html', close file, done!

http://www.javascriptkit.com/howto/htaccess6.shtml
Copy linkTweet thisAlerts:
@ray326Nov 25.2006 — And then you have a bunch of other "files with the same name" to deal with. You're much better off just using the standard index file for the purpose.
×

Success!

Help @Ninko spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...