htaccess Help

Discussion in 'Apache' started by SirTiner, Jan 24, 2009.

  1. #1
    Hi guys,

    Could someone tell me if this is OK, everything works but i need to know that it is ok. its non www to www, /index.php to / and url mapping.
    And also, can i add:

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/
    RewriteRule ^index\.php$ http://www.website.com/ [R=301,L]

    So its /index to /

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>

    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^website\.com$ [NC]
    RewriteRule ^(.*)$ http://www.website.com/$1 [R=301,L]

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.website.com/ [R=301,L]

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+\.)+php\ HTTP
    RewriteRule ^(.+)\.php$ http://www.website.com/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ $1.php [L,QSA]
     
    SirTiner, Jan 24, 2009 IP