Webmail and mail redirect

Hi,

Is there a way i can setup mail.domain.tld to redirect the same way webmail.domain.tld redirect to a custom link?

I need some general feature same as webmail.domain.tld.

Thank you.

Status: 
Active

Comments

Howdy -- Virtualmin only has two built-in redirects, one for webmail.domain.tld, and one for admin.domain.tld.

There isn't a Virtualmin-supported system for setting up additional redirects, though you could always do it by first adding a new Virtual Server Alias, and then manually editing the Apache config to add redirect code. You can then copy the redirect code for the "webmail" alias in the Apache config.

Any alternative method? Like modify the code or something?

It would take a fair bit of code modification to add an additional redirect.

I added a simple rule in Vitualmin -> Services -> Configure Website -> Edit Directives

RewriteCond %{HTTP_HOST} =mail.domain.tld
RewriteRule ^(.*)$ http://www.domain.tld/roundcube/ [R]

And it works on some domains but on others dosen't. What did i do wrong? What did i missed?

What happens when it doesn't work? Do you get an error of some sort?

And did you add a "mail.domain.tld" alias to those domains?

Also, make sure you restart Apache afterwards -- if Apache hasn't been restarted, those changes wouldn't be in effect.

I don't get any errors. I just get index.html, same as i would be accesing from www.domain.tld.

I didn't add any domain alias, can't i use apache to redirect them since there allready is a DNS record for mail.domain.tld ?

Restarted apache.

Ok, i got it working in 3 steps.

  1. Create Virtual Server -> Alias of domain.tld -> mail.domain.tld
  2. Virtualmin -> Services -> Configure Website -> Edit Directives
RewriteCond %{HTTP_HOST} =mail.domain.tld
RewriteRule ^(.*)$ http://www.domain.tld/roundcube/ [R]

Works like a charm.