/etc/apache2/sites-avaiable/domain.com.conf

Hi, I am intending to make one of my domains redirect from webmail.domain.com to domain.com/roundcube, just because people are more used to type webmail.domain.com

I searched and found how to make a global roundcube server. But that wasnt the case… So I looked in my apache’s config and found theses conf files in /etc/apache2/sites-avaiable/domain.com.conf

Inside this particular domain, I changed to:

RewriteCond %{HTTP_HOST} =webmail.domain.com
RewriteRule ^(.*) http://domain.com/roundcube [R]

but it didnt work…

What else shoul I do?

Howdy,

What you did there should definitely work.

Did you by chance restart Apache afterwards? Without restarting Apache those settings wouldn’t actually become active.

-Eric

I reboot the machine…

I also noticed that www.domain.com is not redirecting to domain.com, Already checked the DNS seems ok… You think these are related?

Ok, look what I saw right now:

Failed to start service :

  • Starting web server apache2
  • The apache2 configtest failed.
    Output of config test was:
    AH00526: Syntax error on line 28 of /etc/apache2/sites-enabled/domain.com.conf:
    RewriteRule: bad flag delimiters
    Action ‘configtest’ failed.
    The Apache error log may have more information.

Fixed, but I still dont know why it is not working…

If I try to ping in webmail.domain.com it doesnt translate to my VPS IP as it does when I ping at www.domain.com, should I create a CNAME for webmail???

Where is the DNS being hosted for this domain? Is it being hosted by Virtualmin, or by a third party?

If it’s hosted by Virtualmin, all the DNS entries are created automatically.

But if it’s by a third party, you’ll need to manually setup every DNS entry you wish to use, including webmail.domain.com.

-Eric

I guess it was hosted by third party… I have a VPS at digital ocean. And they have a DNS manager there, when I added the webmail CNAME, it started to work!

How could I host DNS by Vitualmin ?

Howdy,

You can find information on that in the section titled “How do I setup nameservers for my server” of the following documentation:

https://www.virtualmin.com/documentation/dns/faq

Alright! Thank you!