No Acces of File Type
Example, don’t allow access to .ini files:
#no direct access of *.ini
RewriteRule ^(.*)\.ini$ http://%{HTTP_HOST}/ [R=301,L]
No Direct Acess of index.php
#no direct access of index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://%{HTTP_HOST}/ [R=301,L]
Force www.
#force www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www\.%{HTTP_HOST}/$1 [R=301,L]
Redirect 301
Redirect 301 /path/old.htm http://www.example.com/new.htm
Hide File Extension
RewriteCond %{REQUEST_URI} !^/(.*)(\.)
RewriteRule ^(.*)$ index.php?do=$1&%{QUERY_STRING} [NC,L]
Image 404 .htaccess
# img not found
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule .* images/spacer.gif [L]
Use .do Extension
Options -Indexes
AddType application/x-httpd-php do php
RewriteEngine On
RewriteRule ^pg.do$ index.php?%{QUERY_STRING} [L]
