Click to See Complete Forum and Search --> : [RESOLVED] .htaccess file? probably not in the right forum..


SaveSheep
01-15-2007, 07:47 AM
i have a bunch of .html files on a site, and i'd like to change it so that i can type in site.com/index and it'll know to look up index.html

RewriteEngine On
RewriteBase /
RewriteRule ^([a-zA-Z0-9])$ $1.html

I tried this, but it still doesn't work. Isn't there a way to make it default to index.html if no variable is called upon?

thanks!

TheBearMay
01-15-2007, 09:57 AM
By default Apache will look for index.html and use it if present, but you can specify it using:

DirectoryIndex index.html

if you like.

SaveSheep
01-15-2007, 10:26 AM
great, thanks alot!

any idea how to make the rest of the script work?

Scleppel
01-15-2007, 03:16 PM
This should do it:
DirectoryIndex index.html
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([a-zA-Z0-9]+)$ $1.html [L]

SaveSheep
01-17-2007, 10:25 AM
That was it! You are the man.