htaccess Tricks #8 – Random Tricks

Activate SSI for HTML/SHTML file types:
# activate SSI for HTML and or SHTML file types
AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
AddHandler server-parsed .htm

Grant CGI access in a specific directory:
# grant CGI access in a specific directory
Options +ExecCGI
AddHandler cgi-script cgi pl
# to enable all scripts in a directory use the following
SetHandler cgi-script

Disable magic_quotes_gpc for PHP enabled servers:
# turn off magic_quotes_gpc for PHP enabled servers
<ifmodule mod_php4.c>
php_flag magic_quotes_gpc off
</ifmodule>

Enable MD5 digests:
Note: enabling this option may result in a relative decrease in server performance.

# enable MD5 digests via ContentDigest
ContentDigest On

Expression Engine Tricks:
# send Atom and RSS requests to the site docroot to be rewritten for ExpressionEngine
RewriteRule .*atom.xml$ http://www.yoursite.com/index.php/weblog/rss_atom/ [R]
RewriteRule .*rss.xml$ http://www.yoursite.com/index.php/weblog/rss_2.0/ [R]

# cause all requests for index.html to be rewritten for ExpressionEngine
RewriteRule /.*index.html$ http://www.domain.com/index.php [R]

Related Posts:

  • htaccess Tricks #7 – WordPress Tricks
    Secure WordPress Contact Forms Protect your insecure WordPress contact forms against online unrighteousness by verifying the domain from whence the form is called. Remember to replace the “domain.co...
  • htaccess Tricks #6 – Redirect Tricks
    Important Note About Redirecting via mod_rewrite For all redirects using the mod_rewrite directive, it is necessary to have the RewriteEngine enabled. It is common practice to enable the mod_rewrite...
  • htaccess Tricks #5 – Usability Tricks
    Minimize CSS Image Flicker in IE6 Add the following htaccess rules to minimize or even eliminate CSS background-image “flickering” in MSIE6:# minimize image flicker in IE6ExpiresActive OnExp...
  • htaccess Tricks #4 – Security
    Prevent Acess to .htaccess Add the following code block to your htaccess file to add an extra layer of security. Any attempts to access the htaccess file will result in a 403 error message. Of cours...
  • htaccess Tricks #3 – Performance
    Improving Performance via AllowOverride Limit the extent to which htaccess files decrease performance by enabling AllowOverride only in required directories. For example, if AllowOverride is enabled...

Tags: , ,

18.Oct.08 Server


You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Leave a Comment

:)