Monday, May 19, 2014

Apache redirection

I want to redirect all of my users who go to www.mywebmailserver.com to webmail.mywebmailserver.com. I have learned that from my googling, there are 2 popular ways to do it in apache web server. First, by using mod_rewrite and second, I can use redirect. The latter is the simplest. So I chose it. :)
Put this in vhost container.

NameVirtualHost www.mywebmailserver.com
<virtualhost www.mywebmailserver.com>
ServerName www.mywebmailserver.com
Redirect 301 / http://webmail.mywebmailserver.com/
</virtualhost>

In Mageia 4, the file is located in /etc/httpd/conf/vhosts.d and the file name is 00_default_vhosts.conf

That's it. Restart or reload apache for the changes to take effect.

Have fun!

No comments:

Renew letsencrypt ssl certificate for zimbra 8.8.15

 Letsencrypt certs usually consists of these files: 1. cert.pem 2. chain.pem 3. fullchain.pem 4. privkey.pem I am not going to discuss about...