# Custom Routing

> Consider using query string instead before deciding to use custom routing, especially when SEO is not a concern.

To use custom route, create a configuration file in `config/default.json` like the following:

```javascript
{
  "routes": {
    "/path/:any": {
      "page": "/path/to/page"
    },
    "/path/:number(\\d+)": {
      "page": "/path/to/another-page"
    }
  }
}
```

Please refer to the following documentation for:

* [Creating configuration files](/soya-next/user-guide/universal-environment-configuration.md)&#x20;
* [Route path pattern](https://expressjs.com/en/guide/routing.html#route-paths)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://traveloka.gitbook.io/soya-next/user-guide/custom-routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
