I use a plugin that redirects all urls in high to version lowercased box. He is very good and helps me avoid duplicate content in Wordpress.
However, there is a list of 800 urls that should be added as an exception to the plugin.
It should not redirect these 800 pages to version lowercased.
Anyone have a solution?
I think this is very simple and anyone with intimacy with php you can help me, but if it is not so simple, I can pay for it.
The Code:
Thanks for all
However, there is a list of 800 urls that should be added as an exception to the plugin.
It should not redirect these 800 pages to version lowercased.
Anyone have a solution?
I think this is very simple and anyone with intimacy with php you can help me, but if it is not so simple, I can pay for it.
The Code:
PHP:
if(!is_admin()){ add_action( 'init', 'storm_force_lowercase' );}
function storm_force_lowercase(){
$url = $_SERVER['REQUEST_URI'];
if(preg_match('/[\.]/', $url)){ return; }
if(preg_match('/[A-Z]/', $url)){
$lc_url = strtolower($url); header('HTTP/1.1 301 Moved Permanently'); header("Location: " . $lc_url); exit(0); }
}
Thanks for all