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 [...]

Tags: , ,

18.Oct.08 Server Comments (0)

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.com” and “contact.php” with your domain and contact-form file names, respectively. # secure wordpress contact forms via referrer check RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC] RewriteCond %{REQUEST_POST} .*contact.php$ RewriteRule .* [...]

Tags: , ,

17.Oct.08 Server Comments (0)

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 directive in either the server configuration file or at the top of the site’s root htaccess file. If the mod_rewrite directive is not included in either [...]

Tags: , ,

17.Oct.08 Server Comments (0)

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 IE6 ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/png A2592000 Deploy Custom Error Pages Replicate the following patterns to serve your own set of custom error pages. [...]

Tags: , ,

17.Oct.08 Server Comments (0)

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 course, your first layer of defense to protect htaccess files involves setting htaccess file permissions via CHMOD to 644: # [...]

Tags: , ,

16.Oct.08 Server Comments (2)

:)