Mobile app version of vmapp.org
Login or Join
Tiffany637

: .htaccess Forward all mail subdomains to /webmail/ I would like to write a .htaccess rewrite command that takes any url with a subdomain mail and forwards them to whatever domain included that

@Tiffany637

Posted in: #Directory #Htaccess #Subdomain

I would like to write a .htaccess rewrite command that takes any url with a subdomain mail and forwards them to whatever domain included that subdomain with /webmail at the end.

e.g.

mail.zane.com would forward to zane.com/webmail
mail.prowebmasters.com would forward to prowebmasters.com/webmail.

In short, I have a master domain with my host with addon domains in folders on the master domain. Any time I type mail.site.com it is forwarding to the index.html of the master site. Instead of doing that I want the sites to open /webmail/ of the site.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

This will work but you'll have to copy the rewrite into each domains .htaccess file.

RewriteCond %{HTTP_HOST} ^mail.domain.com$
RewriteCond %{REQUEST_URI} !^/webmail/
RewriteRule (.*) /webmail/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme