Archive for the 'Mod Rewrite' Category

HTACCESS Code (General Purpose) • Monday, March 6th, 2006

This is basically what I use to manage dynamic URLs.

RewriteCond %{QUERY_STRING} ^(.+)$ [NC] RewriteRule ^(.*)$ - [F,L] Protects against bogus query strings attached to the end of a URL. This code is customized to issue a forbidden instead of a 404.
RewriteCond %{REQUEST_URI} ([a-z0-9]+)\.html$ [NC]
RewriteRule ^([a-z0-9]+)\.html /script.file?p_path=$1 [L] This allows dynamic xyz.html under a directory and […]

Handling Erroneous Dynamic URLS • Monday, March 6th, 2006

When creating dynamic pages, make sure you handle weird urls so that malicious linking doesn’t lead to the indexing of non-existent urls. Use HTTP header checker to see server responses. Catch all invalid requests with a custom 404 page. What URLS to check? Try to let .htaccess handle as much of the 404s as possible […]