Forum Moderators: phranque
RewriteEngine On
RewriteCond %{REQUEST_URI} index.html$
RewriteRule (.*)index.html $1 [R=302,L]
But it goes into an infinite loop of some sort and doesn't work. Any ideas?
Thanks MUCH appreciated in advance.
Basil
Welcome to WebmasterWorld [webmasterworld.com]!
Yes, it will go into an infinite loop, unless you change the name of the actual index file.
If you want to sort this out, first change all internal links on your site to refer to your index page(s) as "../", "/", or "http://yourdomain.com/path_to_directory/". Having done that, you can change the server's default index page using "DirectoryIndex" in Apache. Name your index page something other than "index.html" or "index.htm". Then you can redirect all requests for "index.html" to your actual index file, but leave requests for "/" as-is.
If you later opt to change to php, cfm, asp, or whatever, all you'll need to do is change the DirectoryIndex directive, and you'll be done. This is actually the main reason to prefer linking to your index pages(s) using "/" instead of specifying a filename and filetype (and thereby, the technology).
Jim
If you later opt to change to php, cfm, asp, or whatever, all you'll need to do is change the DirectoryIndex directive, and you'll be done. This is actually the main reason to prefer linking to your index pages(s) using "/" instead of specifying a filename and filetype (and thereby, the technology).
Change noted. But other people still link to my pages with the "index.html" included. So how can I rewrite the URL to eliminate that "index.html" fragment?