-
Notifications
You must be signed in to change notification settings - Fork 12
Handle document URLs with no lang param #204
Comments
From the API this should already be ok: If a language is given as parameter, associated documents include the "best" language. |
When such a URL is called, we would need to make a request to the API to get the list of available lang for the given document and make a 301 "Moved permanently" redirection to the URL with the most appropriate lang (+ slug). If there's only one lang available, the choice is easy. If several, we would take the priority listed here https://github.com/c2corg/v6_common/blob/master/c2corg_common/attributes.py#L2 |
This works already. For example when you request
|
As discussed with @asaunier: When calling To avoid problems with Varnish, this view is not cached. |
In v5 documents [1] may contain other document URLs with no lang parameter (only the doc type and the doc id) [2].
Such URLs redirect to the "most appropriate" lang version (depending on the lang prefs and the available lang versions). A similar behaviour is needed in v6.
By the way document URLs should contain slugs (but the current version with no slug should also work). See #109
[1] for instance http://www.camptocamp.org/summits/37355/fr/mont-blanc
[2] for instance http://www.camptocamp.org/routes/55289
The text was updated successfully, but these errors were encountered: