Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite redirect

         

dnps

2:38 pm on Mar 29, 2005 (gmt 0)

10+ Year Member



This may look as a dumb idea, just need your advice on this.
When requested url does not have document name in it I need mod_rewrite to return the actual index file name of that directory so it would be displayed in the browser.
for example:
if the requested URL is: /newstoday/ or /any/other/path
redirect to /newstoday/index.html or /any/other/path/index.cfm
Basically forcing browser to reveal complete URL

the actual problem with this is that we have different indexes in different folders
and I need the rule to determine what the actual file is.

Here is a list of available index files:
index.html
index.htm
index.cfm

Please HEEELP

P.S.
some rules that i have tried to make would redirect the browser to the same URL over and over :-(

this one is actually worked on 1 server, i'm not sure why:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteBase /
RewriteRule ^(.*)$ %{REQUEST_URI} [R]