# Access Mailbox From A Subdomain

**URL:** <https://discourse.mailinabox.email/t/access-mailbox-from-a-subdomain/696>\
**Category:** Improvements\
**Created:** [July 25, 2015, 3:37pm UTC](https://discourse.mailinabox.email/t/access-mailbox-from-a-subdomain/696 "2015-07-25T15:37:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![just4t](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/just4t/32/1838_2.png) [@just4t](https://discourse.mailinabox.email/u/just4t)\
**Post date:** [July 25, 2015, 9:23pm UTC](https://discourse.mailinabox.email/t/access-mailbox-from-a-subdomain/696/3 "2015-07-25T21:23:24Z")

</div>

@nate as @ibib said, the best option knowing we can’t use a **.htaccess** file (not apache installed) and the option of customizing **/etc/nginx/conf.d/local.conf** will force us to re-edit it each time we’ll upgrade MiaB then, the best way I see to achieve this is by using a custom **/home/user-data/www/default/index.html** file as follows:

```
<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=https://box.yourdomain.com/mail">
        <script type="text/javascript">
            window.location.href = "https://box.yourdomain.com/mail"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        If you are not redirected automatically, follow this <a href='https://box.yourdomain.com/mail'>link to /mail</a>
    </body>
</html>

```

- Edit it by replacing **[box.yourdomain.com](http://box.yourdomain.com)** by your own **server\_name**.

- Note we are using a **meta** , and a **javascript** redirections plus a **link** inside the **index.html** static file that should make the desired redirection to work well within any browser.

Hope this helps!

---

_[View the full topic](https://discourse.mailinabox.email/t/access-mailbox-from-a-subdomain/696)._
