The Dispatcher is one of the main technical features of v1.5. It handles URL redirections. Instead of using multiple files in the root folder like
category.php, only one file is used:
index.php. From now on, internal URL will look like
Additionally, the Dispatcher is built to support URL rewriting. Therefore, when URL-rewriting is off, PrestaShop will use the following URL form:
...and when URL-rewriting is on (or "Friendly URLs"), PrestaShop's Dispatcher will correctly support this URL form:
There are several advantages for this system:
- It is easier to add a controller.
- You can use custom routes to change your friendly URLs (which is really better for SEO!)
- There is only one single entry point into the software, which improves PrestaShop's reliability, and facilitates future developments.
The Dispatcher makes use of three abstract classes:
AdminController (the last two inheriting from the first one).
New routes can be created by overriding the
The store administrator can change a controller's URL using the "SEO & URLs" page in the back-office's "Preferences" menu.