URL handling: verschil tussen versies
(nailed it!) |
(→Internationalisation) |
||
(4 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
To avoid link rot and optimise search engine results there is a consistent (legacy) way of dealing with URLs on the petities.nl website. | To avoid link rot and optimise search engine results there is a consistent (legacy) way of dealing with URLs on the petities.nl website. | ||
− | With the 2015 release we need to internationalise this structure. The 2015 will listen to the three domains petities.nl, petitions.nl and petitions.eu. The last two are a language indicator for English as the default language, the first for Dutch | + | With the 2015 release we need to internationalise this structure. The 2015 release will listen to the three domains petities.nl, petitions.nl and petitions.eu. The last two are a language indicator for English as the default language, the first for Dutch. |
− | + | ||
− | + | ||
The database has these fields which supplies important information for URLs: | The database has these fields which supplies important information for URLs: | ||
Regel 52: | Regel 50: | ||
With the internationalisation this structure becomes more complicated. The same petition in two languages should be reachable with both links for each language if the translations differ. If the link is the same in both languages, then the version matching the language setting in the browser should be served. Unless there is an override in the form of a cookie set by the language switcher on our website(s). | With the internationalisation this structure becomes more complicated. The same petition in two languages should be reachable with both links for each language if the translations differ. If the link is the same in both languages, then the version matching the language setting in the browser should be served. Unless there is an override in the form of a cookie set by the language switcher on our website(s). | ||
+ | |||
+ | When a link has '''?locale=en''' as appendix it is redirected to the corresponding page on the petitions.eu domain. When a link ends with '''?locale=nl''' it redirects to the corresponding page on petities.nl. When a link includes ?locale=$$ the page is served in the language $$ indicated with the characters following the = sign. For example petitions.eu/petition/this-is-an-example-of-a-petition?locale=fr will serve the French version of the petition, with the website in the English interface. petities.nl/petitie/dit-is-een-voorbeeld-van-een-petitie?locale=fr will serve the French version in the Dutch interface. When the cached_slug is unique it switches to the appropriate language and domain, with petitions.eu/petition/voici-un-exemple-de-un-pétition for the English interface and petities.nl/petition/voici-un-exemple-de-un-pétition for the Dutch interface around this French petition. | ||
+ | |||
+ | Gradually also translated interfaces will become available. Those will appear under the petitions.eu domain. | ||
+ | |||
+ | ==petition_translations== | ||
+ | New table, should also get the subdomain value. | ||
+ | |||
+ | =Custom domains= | ||
+ | |||
+ | When a petitioner wants to direct their own (campaigning) domain to the petition, this can be added by the admin on request through a webinterface which changes the apache config file. | ||
[[Category:Developer]] | [[Category:Developer]] |
Huidige versie van 17 sep 2015 om 09:12
To avoid link rot and optimise search engine results there is a consistent (legacy) way of dealing with URLs on the petities.nl website.
With the 2015 release we need to internationalise this structure. The 2015 release will listen to the three domains petities.nl, petitions.nl and petitions.eu. The last two are a language indicator for English as the default language, the first for Dutch.
The database has these fields which supplies important information for URLs:
petitions.subdomain
petitions.cached_slug
offices.subdomain
offices.cached_slug
newsitems.cached_slug
pages.cached_slug
signatures.confirmed
Inhoud
petitions.subdomain
This is the easy domain which can be pronounced on radio, television, by telephone, in person etc. The subdomain is followed by the domain name. For example example.petities.nl or example.petitions.eu. This URL is not served over https but redirects immediately to the following, longer link.
petitions.cached_slug
The long link is the (https) link which should never change and is also fed to the search engine crawlers. In case the title of the petition changes, for example after correcting a typo, the cached slug also changes because it is based on the petition title. The previous cached_slug then redirects to the new one. The structure of such a long link for the petition 'This is an example of a petition' is for example http://petities.nl/petitie/this-is-an-example-of-a-petition or http://petitions.eu/petition/this-is-an-example-of-a-petition
offices.subdomain
The link a petition desk can advertise with, for example cityname.petities.nl and cityname.petitions.eu, not over https.
offices.cached_slug
The is the longer https version of the previous one, but in practise it just means a different order of the domains. For example: http://petities.nl/loket/plaatsnaam for plaatsnaam.petities.nl. Or http://petitions.eu/desk/cityname for cityname.petitions.eu
newsitems.cached_slug
Newsitems for a petition each have their own URL: http://petities.nl/nieuws/link-naar-nieuws-over-petitie In case the item is translated, the translated version gets its own url, for example https://petitions.eu/news/link-to-news-about-petition
pages.cached_slug
There are a handful of pages for the entire site. They also have a permanent location.
signatures.confirmed
Signatures need confirmation on a unique, personal, confidential link served over https. https://petities.nl/ondertekening/anda30characterslongkey for the Dutch version and https://petitions.eu/signature/anda30characterslongkey or https://petitions.nl/signature/anda30characterslongkey for the English version.
Internationalisation
With the internationalisation this structure becomes more complicated. The same petition in two languages should be reachable with both links for each language if the translations differ. If the link is the same in both languages, then the version matching the language setting in the browser should be served. Unless there is an override in the form of a cookie set by the language switcher on our website(s).
When a link has ?locale=en as appendix it is redirected to the corresponding page on the petitions.eu domain. When a link ends with ?locale=nl it redirects to the corresponding page on petities.nl. When a link includes ?locale=$$ the page is served in the language $$ indicated with the characters following the = sign. For example petitions.eu/petition/this-is-an-example-of-a-petition?locale=fr will serve the French version of the petition, with the website in the English interface. petities.nl/petitie/dit-is-een-voorbeeld-van-een-petitie?locale=fr will serve the French version in the Dutch interface. When the cached_slug is unique it switches to the appropriate language and domain, with petitions.eu/petition/voici-un-exemple-de-un-pétition for the English interface and petities.nl/petition/voici-un-exemple-de-un-pétition for the Dutch interface around this French petition.
Gradually also translated interfaces will become available. Those will appear under the petitions.eu domain.
petition_translations
New table, should also get the subdomain value.
Custom domains
When a petitioner wants to direct their own (campaigning) domain to the petition, this can be added by the admin on request through a webinterface which changes the apache config file.