12 htaccess Tips


1. Redirect to a secure https connection

If you want to redirect your entire site to a secure https connection, use the following:

  1. RewriteEngine On
  2. RewriteCond %{HTTPS} !on
  3. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

2. Block script execution

You can stop scripts in certain languages from running with this:

  1. Options -ExecCGI
  2. AddHandler cgi-script .pl .py .php .jsp. htm .shtml .sh .asp .cgi

3.  [Read more...]