> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.bearsampp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Apache Aliases in Bearsampp

> Create Apache aliases in Bearsampp to expose any folder on your system at a URL path like http://localhost/myalias/ — no hosts file changes required.

Apache aliases let you map a URL path to any folder on your system without moving the folder into the `www/` directory. For example, you can make `http://localhost/myalias/` serve files from `D:\projects\myapp\` — useful for projects you keep outside the Bearsampp directory tree.

## Aliases vs. virtual hosts

|                              | Aliases                                   | Virtual hosts               |
| ---------------------------- | ----------------------------------------- | --------------------------- |
| **URL format**               | `http://localhost/myalias/`               | `http://myapp.local/`       |
| **Hosts file change needed** | No                                        | Yes                         |
| **SSL certificate**          | No (uses localhost)                       | Yes (auto-generated)        |
| **Best for**                 | Quickly exposing a folder under localhost | Separate domain per project |

Use aliases when you want a quick path under `localhost`. Use virtual hosts when you need a realistic separate domain. See [Virtual Hosts](/configuration/virtual-hosts) for the latter.

## How to add an alias

<Steps>
  <Step title="Right-click the Bearsampp tray icon">
    Find the Bearsampp icon in your Windows system tray and right-click it.
  </Step>

  <Step title="Open the Apache menu">
    Hover over **Apache** in the context menu.
  </Step>

  <Step title="Click Add an alias">
    Click **Add an alias**. A dialog opens with two fields.
  </Step>

  <Step title="Enter the alias name">
    In the **Name** field, type the alias name you want to use. This becomes the URL path segment — for example, entering `myalias` makes the alias available at `http://localhost/myalias/`.

    The name must be alphanumeric (letters and numbers only, no spaces, hyphens, or dots).
  </Step>

  <Step title="Set the destination folder">
    Click **Browse** next to the **Destination** field and select the folder you want the alias to point to.
  </Step>

  <Step title="Click Save">
    Click **Save**. Bearsampp creates the alias configuration file and restarts Apache automatically.
  </Step>
</Steps>

<Warning>
  The alias name must contain only letters and numbers. Names with hyphens, underscores, spaces, or dots are not valid and will be rejected.
</Warning>

## What Bearsampp creates

When you save an alias, Bearsampp creates a configuration file at:

```
bearsampp\alias\myalias.conf
```

This file contains an Apache `Alias` directive pointing `http://localhost/myalias/` to the folder you selected. Apache is restarted automatically to load the new alias.

## Accessing your alias

After saving, open your browser and navigate to:

```
http://localhost/myalias/
```

Replace `myalias` with the name you chose. No hosts file changes are needed — aliases work under `localhost` without any additional configuration.

## Edit an alias

<Steps>
  <Step title="Open the Apache menu">
    Right-click the tray icon and hover over **Apache**.
  </Step>

  <Step title="Click Edit [aliasname]">
    In the **Aliases** submenu, click the alias you want to edit. The edit dialog opens, pre-filled with the current name and destination.
  </Step>

  <Step title="Make your changes and save">
    Update the alias name or destination folder, then click **Save**. Apache restarts to apply the change.
  </Step>
</Steps>

## Delete an alias

<Steps>
  <Step title="Open the Apache menu">
    Right-click the tray icon and hover over **Apache**.
  </Step>

  <Step title="Click Edit [aliasname]">
    Open the edit dialog for the alias you want to remove.
  </Step>

  <Step title="Click Delete">
    Click **Delete** and confirm. Bearsampp removes `bearsampp\alias\aliasname.conf` and restarts Apache.
  </Step>
</Steps>

<Note>
  Deleting an alias only removes the Apache configuration file. The destination folder and its contents are not affected.
</Note>
