You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Scott Taylor <sc...@bigfoot.com> on 2004/03/03 17:01:51 UTC

[users@httpd] .htaccess file

Can someone show me how to write an .htaccess file so that the root of 
every directory will load the index.php file if the index.html and 
index.htm are not present?  If not, can someone direct me somewhere on 
the web that can show me this sort of thing?

Thanks in advance,

Scott Taylor


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess file

Posted by Peter <pe...@hostmansion.com>.
Put this in the .htaccess file:

DirectoryIndex index.html index.htm index.php

BIVOL

----- Original Message ----- 
From: Scott Taylor 
To: users@httpd.apache.org 
Sent: Wednesday, March 03, 2004 6:01 PM
Subject: [users@httpd] .htaccess file



Can someone show me how to write an .htaccess file so that the root of 
every directory will load the index.php file if the index.html and 
index.htm are not present?  If not, can someone direct me somewhere on 
the web that can show me this sort of thing?

Thanks in advance,

Scott Taylor


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess file

Posted by Dave Floyd <da...@pa.press.net>.
Scott,
	You don't need to do it this way. Just find the section in 
httpd.confand modify as below:

>#
># DirectoryIndex: Name of the file or files to use as a pre-written HTML
># directory index.  Separate multiple entries with spaces.
>#
><IfModule mod_dir.c>
>    DirectoryIndex index.html index.htm index.php
></IfModule>


rgds
dave

>Can someone show me how to write an .htaccess file so that the root 
>of every directory will load the index.php file if the index.html 
>and index.htm are not present?  If not, can someone direct me 
>somewhere on the web that can show me this sort of thing?
>
>Thanks in advance,
>
>Scott Taylor
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] .htaccess file

Posted by Ben Yau <by...@cardcommerce.com>.
>
>
> Can someone show me how to write an .htaccess file so that the root of
> every directory will load the index.php file if the index.html and
> index.htm are not present?  If not, can someone direct me somewhere on
> the web that can show me this sort of thing?
>
> Thanks in advance,
>


Is the URL without a file name?
Meaning someone enters into the address field of their browser:
http://website/dir

and you want it to load
http://website/dir/index.html
and if it doesn't exist
http://website/dir/index.htm
and if it doesn't exist
http://website/dir/index.php  ?


Anyway, the first one can be done using DirectoryIndex.  Here is specific
part of docs that explain it.

http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex

Ben


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org