I’m now developing a rails application.
For localisation. I want to use an approach like below.
-
Site Top Pages
protocol: http
domain: multiple subdomains between country codes: en.myapp.com, it.myapp.com, fr.myapp.com -
Account Pages
protocol: https
domain: one main domain using i18n for changing languages between users.
For SEO, I want to put static pages(promotional pages) into separate servers between country.
I’m using heroku. How can I connect dynamic contents on heroku server and static contents in multiple different servers?
For example, I want to pass attribute like :locale when user enter account pages from static pages. Is it possible?
Edit
I searched about this issue, and now thinking an approach below would be good.
Host subdomain static pages into separate server or separate Heroku apps.
Set cookie like “:locale = ko-kr” when user changes language in each subdomain pages and redirect to other subdomain pages: ko-kr.myapp.com
Share cookie between(if the user already logged in, use’s country and locale code inside database) main domain and subdomains. change language dynamically based on the cookie when user enter the signup or login page.
Is this approach work? If you know alternative approaches, I want to know that.
What db storage are you using?
With MySQL, this can become very tricky.
You’d need a central MySQL server unless you want to experience db sharding which is overkill for a new project IMO.
With a central server, the latency between MySQL and your local country server will be far worst than latency users could experience if they were accessing a server in another country!
If I were you, I’d just sign up for a CDN to speed up site loading across all websites. Easy to set-up.
And having a server physically in the country you’re targeting won’t help much. It’s one parameter in the very long list of google rankings factor … and not a very important one from what I found so far.