wordpress strange redirect

WordPress is using lowercase in all urls but when someone types the url in the address bar then browser uses uppercase to encode url

Uppercase is different from lowercase and wordpress can’t match url

So solution is very simply

This fragment need to be pasted in functions.php

function unFocus_insensitivity() {
    if (preg_match('/[A-ZА-Я]/', $_SERVER['REQUEST_URI'])) {
        $_SERVER['REQUEST_URI'] = strtolower($_SERVER['REQUEST_URI']);
        $_SERVER['PATH_INFO']   = strtolower($_SERVER['PATH_INFO']);
add_action('init', 'unFocus_insensitivity');

Code is working for Latin and Cyrillic letters

С етикет: , , , ,
Публикувано в wordpress

Вашият коментар

Вашият имейл адрес няма да бъде публикуван. Задължителните полета са отбелязани с *