Posts

Showing posts from January, 2007

Rewrite: Captialize first letter

A useful mod_rewrite routine which capitalizes the first letter of the request and does some other clever stuff, thanks to Peter on http://forum.modrewrite.com for the advice. RewriteEngine On RewriteMap uppercase int:toupper RewriteMap lowercase int:tolower RewriteRule ^misc\.php$ - [L] RewriteCond %{REQUEST_URI} !^.*/[A-Z][^A-Z]+\.php$ RewriteRule ^/misc/(.)(.+)\.php$ /misc.php?do=page&template=${uppercase:$1}${lowercase:$2} [NC,R=301,L]