This post explains how we can add routes which resolve to a webpage.
Frappe installation provides several routes by default. Some of them are /about /contact, /newsletters etc.
You might want your about page to be served from /about-us and not only from /about. Similarly you might want your contact page to be served fromm /contact-us and not only from /contact.
If you access foo.bar:8000/contact-us, you would see a 404 page.
There is a hookpoint called website_route_rules in hooks.py which allows adding route rules.
Create an app so that we have a hooks.py where we can add route.
This would ensure that the About page which is otherwise only accessible from /about is not also accessible from /about-us. Similarly Contact page is served from both /contact and /contact-us.
Thank you for reading the Agiliq blog. This article was written by Akshar on Aug 8, 2018 in python , frappe , erpnext .