Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

I've gotten locales up and running on a site, but would like it to automatically route to /no for norwegian visitors and /en for all other visitors. For the life of me I seem uncapable of finding a way using the built in functions.

Do I need to write a plugin to handle this or is there some clever trick I haven't thought of? Can't find anything on geolocation at all.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

The mod_geoip2 Apache module with a redirect in .htaccess file.

See: http://dev.maxmind.com/geoip/legacy/mod_geoip2/

share|improve this answer
    
This is a good idea! I'll check with my VPS host if they could enable this so I could give it a try (they're handling everything through puppet, so kinda reluctant to add stuff myself). –  Broxxi Jul 13 at 16:40

Not exactly related but might help. You can define locales in combination with urls, so you can point no.yourdomain.com to no locale and yourdomain.com to the default locale. Will need to see some more documentation, but this might help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.