I'm deciding how to organize URL and put locale into it. I have two choices:
- example.com/en/page
- example.com/page?locale=en -- Google way
- en.example.com/page -- isn't good because I'm using subdomains
From one side example.com/en/page
looks better and more compact than example.com/page?locale=en
.
From other side we have two URLs example.com/en/page
and example.com/ru/page
for one resource with two representations.
Of course in case example.com/page?locale=en
we have two URLs for one resource too, but it is slightly more RESTful on my taste.
What's the best practice? What are you using and why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…