The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  Direct Affiliate

Redirect from upper case to lower case URL's on a Windows server

what is a windows server? IIS? Apache under windows?

how to use mod_rewrite to lower-case the destination? has a similar predicament on apache...

anyway, its not that easy, it seems...

Personally, i'd do something like:
RewriteRule ^([A-Z]+).html$ redirect.php?page=$1 [L]

if you have filenames like PAGE_TWO or PAGE-TWO, then simply add the chars like [A-Z_-]

and then have redirect.php can be like so:
PHP:
<?PHP

header("Location: " . strtolower($_GET['page']));

?>

if it's an IIS server, google on how you setup rewrites on that, but the regex is going to be similar
 
<?PHP

header("Location: " . strtolower($_GET['page']));

?>


I do not think the above will work. Basically it makes an endless loop of redirection. Even-if $_GET is having all lowercase this code will redirect again to lowercase.

But if you can add a if else to check the $_GET and do the redircect only if URL contains Uppercase (and in other case do nothing)on it this code will work

Regards
Prasad
 
Last edited by a moderator:
banners
Back