Nouveau système de routage
From Joomla! Documentation
Le nouveau système de routage
Introduction
The new routing system defines a new and more flexible interface for developers to handle creating and processing URLs and gives end users more options as it relates to how URLs are displayed (including the often requested ability to remove content item IDs from the URL).
As of Joomla! 3.8, for the components which support the new router (Content, Contacts, Users, and Newsfeeds), it is possible to set up the router to run in one of three different configurations:
- The current routing system (which will remain the default behavior for new installations and the option that will be generally recommended for existing sites when upgrading),
- The new routing system,
- The new routing system with content item IDs removed.
Remarque
Because the URLs generated with the new routing system are not 100% compatible with the existing router and its URLs, it is suggested that existing sites do not enable the new system without thoroughly testing their sites in a staging environment and addressing any URL changes.
New sites are encouraged to make use of the new system immediately.
Quels sont les changements dans les URL ?
When SEF options are enabled, here are two pages from the testing sample data set with each of the routing configurations:
- Animals Photo Gallery Category Page:
- Routeur existant : /article-categories/72-park-site/photo-gallery/animals
- Nouveau routeur activé avec les ID : /article-categories/26-park-site/28-photo-gallery/72-animals
- Nouveau routeur activé sans les ID : /article-categories/park-site/photo-gallery/animals
- Koala Article Page:
- Routeur existant : /article-categories/72-park-site/photo-gallery/animals/25-koala
- Nouveau routeur activé avec les ID : /article-categories/26-park-site/28-photo-gallery/72-animals/25-koala
- Nouveau routeur activé sans les ID : /article-categories/park-site/photo-gallery/animals/koala
The numbers indicate the IDs of your categories and articles.
With the new router and the Remove IDs option enabled, the IDs are removed, which allow to have cleaner and more friendly URLs. It will also improve your SEO.
Comment puis-je activer le nouveau système de routage ?
The New Routing System is available for Content, Contacts, Users, and Newsfeeds. The way to enable this new features is the same for each of them.
Prenons comme exemple le composant de Contenu.
- Connectez-vous au backend
- Dans le menu haut, allez dans Contenu → Articles
- Cliquez sur le bouton Paramètres en haut à droite 800px
- Cliquez sur l'onglet Intégration 800px
- Activez le nouveau système de routage :
- Cliquez sur Expérimental pour activer le nouveau routage d'URL
- Cliquez sur Oui si vous souhaitez supprimer les ID. 800px
- Cliquez sur Enregistrer ou Enregistrer & fermer en haut à gauche
- Visitez le frontend de votre site et vérifiez vos URL.
(N'oubliez pas de nettoyer vos caches pour pouvoir voir les changements.)
Follow the same process for Contacts, Users and Newsfeeds.
NB: There are cases where changing the routing system can change a page’s URL and cause an existing page to give a 404 response. Developers are still discussing ideas for a migration plan to keep old URLs working to some extent.