You do NOT!!
You ESPECIALLY do NOT if the filename is also an "index" filename.
Servers already do a "silent" redirect (302 response) if the URI terminates in a trailing slash '/' then search the specified folder for a file in the list of index files specified in httpd.config or .htaccess in the case of Apache or the default document list for IIS, they also do a "silent" redirect to the trailing slash URI version if the requested URI terminates without a file extension and a trailing slash is not present.
So when trying to redirect to a named document that is also in the index file list there's every chance you are going to create a locked loop.
You can redirect FROM an index file to the root of a folder by using THE_REQUEST directive
Also it would be impossible to write a rediect that attempted to match on "index.html" NOT being in the HTTP request as that would try to redirect EVERY request for any filename to the root.
Just in case you didn't know when apache encounters a URL that matches a redirect/rewrite condition it does a second HTTP request which reloads and examines .htaccess again.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|