By walden on
I am looking to create a Spanish translation for ~300 page drupal site. I'd like to use the i18n module, but don't want to change the urls of my English pages for SEO reasons. My urls are currently domain.com/products/overview and I don't want to have the domain.com/en/products/overview alias as part of the site. [i18n seems to automatically assign the en/ prefix to everything]
For the translated site I would like to either use domain.es/products/overview (preffered) or domain.com/es/products/overview
Does anyone know how to kill the en/ for the English version or seen it done elsewhere?
Thanks!
Comments
=-=
may have to use the path.module and create url alias to by pass the/en/ or the pathauto.module
I faced a similar issue
I faced a similar issue recently when I wanted to use the code "br" in a URL instead of "pt-br".
I have patched a few lines in i18n.module that allowed me to create a custom language prefix for URLs only, while using the regular language prefix everywhere else, such as in the HTML headers. I don't know if it's going to work with you, since you want a blank custom prefix, which may cause a few problems. You should try, anyway.
The patch for i18n.module's i18n_get_lang_prefix function is:
and for i18n.module's custom_url_rewrite function:
Now, all you have to do is to create a function in your settings.php called
custom_language_url_prefix. The function below changes "pt-br" into "br" in urls:To use it in your website, replace "pt-br" with "en" and "br" with blank and tell me later if it works with you.
Regards,
José San Martin
http://www.gare7.org/
José San Martin
http://www.chuva-inc.com/
I'll give it a shot, thanks
I'll give it a shot, thanks