I am not sure if this is possible. But I think that would be great, if I can access my mailbox by typing:
mail.domain.com which leads to box.domain.com/mail
Especially for my familiy would that be a great feature, they are all not that techie and I want it to be as easy as possible for them to acces their email accounts. Actually that should just be some lines in the nginx config isn’t it? Cause as far as I know, that redirect is not doable with DNS. Am I wrong?
Dont know about nginx config.
But quick n dirty i would create the subdomain mail.domain.com and
place a index.html file in the static webhosting directory that redirects
the user to box.domain.com/mail.
@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>
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.
Hi, all, I’m trying to test this, but am having an issue, I may be understanding it incorrectly.
Per @Just4t’s instruction, I have www/cloud2.domain.com (cloud is already somewhere else, I’m thinking of moving) and this:
<!DOCTYPE HTML>
<html lang=“en-US”>
<head>
<meta charset=“UTF-8”>
<meta http-equiv=“refresh” content=“1;url=https://mail.domain.com/cloud”>
<script type=“text/javascript”>
window.location.href = “https://mail.domain.com/cloud”
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href=‘https://mail.domain.com/cloud’>link to /cloud</a>
</body>
</html>
My understanding is that if I type cloud2.domain.com it should redirect to the nextcloud link. But it just goes to the default “this is a mail-in-the-box” with failed ssl. Thoughts?
Ok I can fix the second bit, it’s been a bit since I touched it but I am wanting to move my home-based nextcloud to the vps so now I’m tinkering. What do you mean by the first bit?
You are following a 6-year old thread, so you might want to navigate in the MiaB dashboard to the page called ‘Web’ and see if the instructions there can help you.
You should install the redirect index.html to the directory of the domain/subdomain you want to redirect. That domain/subdomain needs to have a DNS record and a cert (which it may, already).
Be default, MiaB assigns every domain the same index.html location, so to change it based on domain and subdomain, you need to click ‘Change’ next to the desired domain/subdomain in the dashboard ‘Web’ page and follow the instructions in the dialog box.
Then place your redirect file in the directory for the domain/subomain that you have just configured.