Simple .htaccess question

Discussion in 'Apache' started by Daedric, Oct 24, 2010.

  1. #1
    Hi,
    I'm new to .htaccess and was wondering whether my .htaccess file is correct.

    My homepage is on index.html. It's a static HTML site that makes use of php include on a few of the HTML pages.

    This is the content of my .htaccess file:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .+ %{DOCUMENT_ROOT}/index.php [L]
    AddType application/x-httpd-php .htm .html


    I don't really understand the code and actually copied it from a tutorial website. I have a feeling the RewriteRule line is not correct. I should change the "index.php" to "index.html" right?

    As for the AddType line, does it mean run all .htm and .html file as php?

    Thank you for your help!
     
    Daedric, Oct 24, 2010 IP
  2. scriptinstaller

    scriptinstaller Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What are you trying to accomplish?
     
    scriptinstaller, Oct 24, 2010 IP
  3. anbu

    anbu Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am newbie. Can anyone help me to set .htaccess please. when i try to set ir, it shows error.thanks in advance.
     
    anbu, Oct 26, 2010 IP