Manivannan
Manivannan

Reputation: 3254

what is the best format for locale in URL path param?

plan is to add {locale} in path parameter of the url, locale values are expected to be "en-US, fr-CH". As per my understanding path parameters should be lower case and dash separated so i prefer to have it as "en-us" but as per locale standards it should be "en-US" with country in caps. what could be the better option among two lister below in this case & share if you have any better option.

Option 1: http://mydomain.***/en-US Option 2: http://mydomain.***/en-us

Upvotes: 1

Views: 3888

Answers (2)

getjackx
getjackx

Reputation: 345

You should use the first option.

As per definition the path part of an URL is case-sensitive. Furthermore locales have a standard too. You should respect both standards.

Upvotes: 1

Nadeem Haddadeen
Nadeem Haddadeen

Reputation: 469

Both are the same, no need to think about it from SEO perspective.

But you have to pay attention to another issues, in PHP the URLs are case sensitive, /site-map is different than site-maP.

If you access the above example, one of them will give you 404 page.

it depends on your technology, also you don't want to confuse the user with these letter.

For me, i prefer to make them all lower cases.

Upvotes: 0

Related Questions