Store performance
My routes are not behaving as expected
Troubleshooting steps for issues with routes.
Keywords: Routes | Redirects | GraphQL
If the store redirect path doesn't work and the routes are not behaving as expected, follow these troubleshooting steps.
Solution
Checking if the redirect is saved in the Rewriter
- Install the GraphQL IDE in your account by running
vtex install vtex.admin-graphql-ide@3.x
. - Access the Admin and go to Store Settings > Storefront > GraphQL IDE.
- Select the
vtex.rewriter@1.x
app from the dropdown list. - Run the following query, replacing
{URL}
with thefrom
path you're having trouble with:
_10 {_10 redirect {_10 get(path: "/{URL}") {_10 from_10 to_10 }_10 }_10 }
The expected response is a JSON object containing all the redirects related to that path, as in the following example:
_10{_10 "data": {_10 "redirect": {_10 "get": {_10 "from": "/about-us",_10 "to": "/my-store"_10 }_10 }_10 }_10}
If the query doesn't return the redirect path
Access the Admin, go to Storefront > Pages > Redirects, and save the desired URL redirects. For more information, check the Managing URL redirects guide.
If the query returns the redirect path
Check if your Store Theme or another app has defined a route with the same path you are attempting to save as a redirect. If the route already exists, the redirect will be ignored.