3
SHARING WITH THE COMMUNITY - Web.config entry for redirecting ONE domain from http to https in SmarterMail 15x
Question asked by Linda Pagillo - 12/13/2018 at 8:24 AM
Unanswered
PLEASE BE ADVISED THAT IT IS REQUIRED TO HAVE URL REWRITE INSTALLED IN IIS IN ORDER FOR THIS TO WORK PROPERLY. A HUGE THANK YOU TO ALI MUALLA FOR THIS ADDITIONAL INFO!

Hi everyone. This is not a question. I wanted to share some very useful info with the community. I just helped a customer who wanted to redirect only ONE of his SM email domains from http to https. Prior to today, I have never had anyone ask me how to do that. Folks usually want to redirect all of their domains to a particular https. I wanted to provide the code I added to the SM web.config file to make this work. I have tested this on SM 15x and it works like a charm. I was told that this will work on SM 16x and 17x, but I have not personally test it as of yet. This is the code...

<rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^mail.exampledomain\.com" />
        <add input="{SERVER_PORT}" pattern="80" ignoreCase="false" />
      </conditions>
      <action type="Redirect" redirectType="Found" url="https://mail.exampledomain.com/{R:1}" />
    </rule>
  </rules>
</rewrite>

I hope some of you guys will find this helpful. I know I did. Please let me know if you have any questions.
Linda Pagillo
Mail's Best Friend
Email: linda.pagillo@mailsbestfriend.com
Web: www.mailsbestfriend.com
Authorized SmarterTools Reseller
Authorized Message Sniffer Reseller
 

8 Replies

Reply to Thread
1
Reto Replied
Thanks for sharing, we use a similar code on our v17 server. But the code will only work if the microsoft url rewrite module is installed - it's not part of the default iis installation.

0
Linda Pagillo Replied
That is correct Reto! :) I just discovered that and I'm going to revise my original post. Thanks so much!
Linda Pagillo Mail's Best Friend Email: linda.pagillo@mailsbestfriend.com Web: www.mailsbestfriend.com Authorized SmarterTools Reseller Authorized Message Sniffer Reseller
1
Jade D Replied
We've used similar for well over a year now but we dont bother about redirecting to custom url's as it requires integration outside of our service offerings, and with thousands of domains it would be a nightmare.

Instead we redirect all requests on port 80 to one ssl domain per mail server and we havent received any complaints from resellers about the returned domain name used within the url.

We've since implemented letsencrypt for webmail, pop, imap & smtp tls and ssl protocols via powershell
Jade https://absolutehosting.co.za
0
Larry Duran Replied
Employee Post
In the latest release of SmarterMail (aka SmarterMail17), if you're a system admin, you can turn on a setting to force domain traffic over HTTPS.  I believe we actually add this at some point in version 16.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
Linda Pagillo Replied
Jade, I agree with you 100%. That is the easiest way to do a redirect. :) I wish I could have done that in this case. The domain I was working with was on a shared server and the customers has like 100 domains hosted on it, but he only needed one to redirect, not all of them.
Linda Pagillo Mail's Best Friend Email: linda.pagillo@mailsbestfriend.com Web: www.mailsbestfriend.com Authorized SmarterTools Reseller Authorized Message Sniffer Reseller
0
Linda Pagillo Replied
Thanks Larry. Question... can you force it on a per-domain basis or does forcing it cause all traffic to route to https?
Linda Pagillo Mail's Best Friend Email: linda.pagillo@mailsbestfriend.com Web: www.mailsbestfriend.com Authorized SmarterTools Reseller Authorized Message Sniffer Reseller
1
Larry Duran Replied
Employee Post
It's on a per domain basis.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
Linda Pagillo Replied
That ROCKS! Thanks again Larry!
Linda Pagillo Mail's Best Friend Email: linda.pagillo@mailsbestfriend.com Web: www.mailsbestfriend.com Authorized SmarterTools Reseller Authorized Message Sniffer Reseller

Reply to Thread