1. FancyPants

    FancyPants New Member Member

    Oct 29, 2009
    I have two indexes in the same folder. one is .html and the other is .php.
    How can i make it load up the html as a default when my website is visited? I dont have access to the apache conf so i was wondering how can I do it in .htaccess. Also i want to hide the extension on index .html, what will the mod_rewrite line be?
  2. timtamboy63

    timtamboy63 New Member Member

    Apr 15, 2009
    DirectoryIndex index.html
    I'm assuming the name of the html file you want default is index.html, if not just change that.

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)$ $1.html
    change the .html for any file extension you want,
    btw that's not my own code, can't remember where I got it from it's just what ive been using for a while

Share This Page