1. #1

    • My Statistics

    Default .htaccess help

    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. #2

    • My Statistics


    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

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):[email protected]

    "Power Corrupts. Absolute Power Corrupts Absolutely"

Results 1 to 2 of 2

Similar Threads

  1. Help with .htaccess
    By woja in forum Web Application/Script Support - Archive
    Replies: 1
    Last Post: 25th Jan 2011, 10:11 PM
  2. .htaccess help.!
    By vorazeal in forum Webmaster Discussion - Archive
    Replies: 1
    Last Post: 25th Dec 2010, 04:59 PM
  3. Htaccess
    By Ambition in forum General Discussion - Archive
    Replies: 3
    Last Post: 5th Oct 2010, 11:24 AM
  4. .htaccess help
    By Nemesis in forum Webmaster Discussion - Archive
    Replies: 1
    Last Post: 21st Mar 2010, 06:13 PM
  5. .htaccess Help
    By ICanSurfNow in forum Technical Help Desk Support - Archive
    Replies: 14
    Last Post: 19th Feb 2010, 09:18 AM