regex - redirect if url doesn't match parameter -


I have a website indexed incorrectly on Google, such as: www.mysite.fr/de-de/mypage < / P>

I need to fix this, redirect it to www.mysite.de/de-de/mypage with 301, to keep it simple, the first level domain (.it, .de, fr ...) should be the second URL parameter (IT, D-Day, FR-FR ...) How can I use .htaccess?

You can use this code in your DOCUMENT_ROOT /.htaccess File:

  Rewrite code at rewrite% {REQUEST_URI} ::% {HTTP_HOST} ^ / ([az] {2}) -. * ?::(? : World Wide Web \.)? Mysite \. $ 1 [NC] rewrite rule Http: //www.mysite.% 1% {REQUEST_URI} [R = 302, L, NE]  

Comments