Rewriter is the app responsible for managing VTEX IO routes related to the storefront. Through the use of the app’s GraphQL API, it is possible to read, create and delete routes in a store.
The Rewriter app has many functionalities that can be configured in its Admin settings page, which are described in the next section. Some of these functionalities are:
- Redirecting routes with specific configurations (ending with
/
, use of uppercase, etc.). - Configuring behavior when using
hreflang
tags, which can be useful for multilanguage stores. - Overriding client-side cache duration for PDPs and PLPs.
Settings
Follow the steps below to access the Rewriter settings page in your store:
1.On VTEX Admin, go to Apps > Extensions Hub > App Management. 2. Search for Rewriter. 3. In the Rewriter app’s box, click on ⚙ Settings. 4. Edit the fields according to your liking. 5. Click on Save.
The table below describes the available settings of the Rewriter app:
Name | Field type | Description |
---|---|---|
Enable 404 for paths with one segment | boolean | Enables 404 for paths with one segment. Make sure your search bar adds map=ft to your URL. For more details, see Enabling 404 pages. |
Routes version | number | The version routes will be saved in. If this is changed, all routes saved in VBase will be invalidated, meaning all translated routes will be missing and the user will have to run the process to generate them manually. |
Blocks default routes in other bindings | boolean | Blocks the default binding's routes in other bindings. |
Enforce URLs in lowercase | boolean | Enforces that all URLs that end with a slash will do a 301 redirection to the corresponding page without the ending slash. |
Enforce URLs without ending slash | boolean | Enforces that all URLs that end with a slash will do a 301 redirection to the corresponding page without the ending slash. |
Remove repeated hreflang tags | boolean | Removes the repeated hreflang tags, prioritizing showing hreflang tags with the current host. |
Enable full locale in the hreflang | boolean | Includes the full locale in the hreflang . |
Remove locales with myvtex | boolean | Removes all hreflang tags on URLs that include myvtex . |
Custom hreflang | array | Associates your custom hreflang tags with the canonical address desired. |
↳ Canonical address | string | The canonical address of the hreflang tag to be modified. |
↳ Custom locale | string | The custom locale that will be used in the hreflang tag for the selected canonical address. |