Twelve .htaccess tips for apache

Came across the Definitive Guide to htaccess Technique posting that nicely summarized the following useful .htaccess tips for webpages being served up by apache:

  1. Create a custom error page.
  2. Prevent directory browsing.
  3. Set the default page of each directory.
  4. Set up a 301 redirect.
  5. Compress file output with GZIP.
  6. Redirect to a secure https connection
  7. Block script execution.
  8. Force a file to download with a “Save As” prompt.
  9. Restrict file upload limits for PHP.
  10. Enable File Caching.
  11. Protect your site from hotlinking.
  12. Disguise your file types.

In addition to the tips. The posting also has common mistakes and don’ts. It’s a great resource for any web admin.

Tags :