When the number of redirects is too high, the Redirects page in the Admin can't process the search. This results in no returned results when the search is run. For more details on the Redirects page, see Managing URL redirects by binding.
Solution
Follow these steps to get the redirects:
- Access GraphQL IDE through the page
{account_name}.myvtex.com/admin/graphql-ide
. Replace{account_name}
with the name of your VTEX account. - Select the
vtex.rewriter@x
app, wherex
is the app version. For example:vtex.rewriter@1.62.0
. - Use the following GraphQL query to list the store's redirects:
query {
redirect{
listRedirects{
routes{
from
to
endDate
type
binding
}
}
}
}
The expected result will be displayed in the following format:
{
"data": {
"redirect": {
"listRedirects": {
"routes": [
{
"from": "/hello",
"to": "hola",
"endDate": null,
"type": "PERMANENT",
"binding": "56bc9434-7b8a-4ab1-a693-36271595a27d"
},
{
"from": "/v/*",
"to": "https://masrefacciones.backend.verbolia.com",
"endDate": null,
"type": "PERMANENT",
"binding": "56bc9434-7b8a-4ab1-a693-36271595a27d"
}
]
}
}
}
}
- Alternatively, if the redirect path you want to find is known, use the following GraphQL query replacing
/hello
with the path of the desired redirect:
query {
redirect{
get(path:"/hello"){
from
to
endDate
type
binding
}
}
}
The expected result will be displayed in the following format:
{
"data": {
"redirect": {
"get": {
"from": "/hello",
"to": "hola",
"endDate": null,
"type": "PERMANENT",
"binding": "56bc9434-7b8a-4ab1-a693-36271595a27d"
}
}
}
}
If the current redirects are not what's expected, the Rewriter app allows you to perform other operations with redirects, such as deleting existing ones and creating new ones. For details on these operations, see the Rewriter GraphQL API guide.
You can also export and import redirects with .csv files
using the Redirects page or the VTEX IO CLI redirects
plugin. For details on importing and exporting redirects, see Managing URL redirects by binding and the VTEX IO CLI command reference.