
Originally Posted by
DMN Webmaster
I think what you want is
RewriteRule ^prod ([^/\.]+)/?$ http://www.domain.com/en/$1 [R=301,L]
This should redirect all pages with prod in thier url
Thanks for your suggestions. All the urls won't have prod in them so I will clarify what we have now and what we want going forward.
Current urls are in the fortmat
Code:
domain.com/about-us.html
domain.com/product1.html
domain.com/service/sub-service.html
domain.com/contact-us.html
etc....
What we need going forward is adding an /en/ e.g.
Code:
domain.com/en/about-us.html
domain.com/en/product1.html
domain.com/en/service/sub-service.html
domain.com/en/contact-us.html
But we will also be adding new languages at the same time using the format
Code:
domain.com/ru/about-us-ru.html
domain.com/de/product1-de.html
domain.com/zh-cn/service/sub-service-zh-cn.html
domain.com/es/contact-us-es.html
I obviously don't want to add a /en/ to urls that already have a language identifier i.e /de/ (German). I am quite happy to have the identifiers in the .htaccess file.
Effectively
[CODE]
Rewrite anything that does NOT have the listed language identifiers to include an /en/ issuing a 301 redirect
[CODE]