MODX Community

Lingua SEO Friendly URLs

About a year and a half ago sjmclean asked this question. I’m trying to achieve the same thing.

When switching languages, I get the language URLs as per following examples: (for English) (for French)
etc …

What I am looking to achieve is to switch these to: (for English) (for French)
etc …

Jimf3000 provided this response, but no specifics.

jimf3000 Reply #5, 1 year, 4 months ago

Hi sjmclean,

I've used the Lingua extra on quite a few projects and it works great.

Like aaronkent, I use .htaccess, but with the addition of Ajax.

1. By using .htaccess to allow for '{country_code}/', you can grab the {country_code} by exploding $_SERVER['REQUEST_URI'] and checking to see if the {country_code} matches the current MODx cultureKey.
2. If they don't match, you can just do an Ajax post to{country_code} and refresh your page.

I’m looking for some example .htaccess code to accomplish this. Anybody have something to share?