# Aliases

CommandBox allows you to create web aliases for the web server that are similar to virtual directories. The alias path is relative to the folder the `server.json` lives in, but can point to any folder on the hard drive. Aliases can be used for static or CFM files.

{% hint style="info" %}
For compatibility reasons as of version `5.3.0`, relative alias paths can also be relative to the web root, if that is not where the `server.json` lives. CommandBox will check if the folder exists relative to the web root FIRST, and if not, it will then check relative to the folder the `server.json` lives in.
{% endhint %}

To configure aliases for your server, create an object under `web` called `aliases`. The keys are the web-accessible virtual paths and the corresponding values are the relative or absolute path to the folder the alias points to.

Here's what your `server.json` might look like.

```javascript
{
  "web" : {
    "aliases" : {
      "/foo" : "bar",
      "/js" : "C:\static\shared\javascript"
    }
  }
}
```

Here's how to create aliases from the `server set` command:

```
server set web.aliases./foo = bar
server set web.aliases./js = C:\static\shared\javascript
```

> **info** On Adobe ColdFusion servers, .cfm files will be run automatically from inside an aliases directory. On Railo and Lucee servers, you'll need to create a CF mapping that maps the alias name and path for .cfm files to work.


---

# 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://commandbox.ortusbooks.com/5.3.0/embedded-server/configuring-your-server/aliases.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.
