Code: Select all
<?php
$uppercaseurlcheck = $_SERVER['REQUEST_URI'];
$converttolower = strtolower($uppercaseurlcheck);
$whatsmyurl = "http://" . $_SERVER['HTTP_HOST'];
if(preg_match('/[A-Z]/', $uppercaseurlcheck)){
header("Location: $whatsmyurl" . $converttolower,TRUE,301);
exit();
}
?>Trouble is, for German characters, such as ö, it seems to think that is not lowercase in PHP, and then tries to set it, which causes POST forms to fail.
I can disable the lowercase function, but it means we have two urls for the same page, potentially.
So how can we do it, by only changing it if there is an uppercase letter? I did read you could do it with htaccess, but it required a conf change too which I am not comfortable with.