URL ReWrite

Discussion in 'General troubleshooting' started by lewiska, Apr 15, 2018.

  1. I currently have a site that I want to be able to have the URL rewrite work for www for the actual URL, but not for the EverLeap secondary URL (xxx.el-alt.com)

    The rule is currently set as follows,

    <rule name="CanonicalHostNameRule1">
    <match url="(.*)" />
    <add input="{HTTP_HOST}" pattern="^www\.sitename\.com$" negate="true" />
    <action type="Redirect" url="http://www.sitename.com/{R:1}" />

    and I think the change I need may be needed to the "match url" value, but nothing I've tried has worked.

    Any ideas of what I need to do to achieve this?
  2. Ray Huang

    Ray Huang Everleap staff

    Yes, I think you need to change the "match url". This link should help you.
    Martin Ortega likes this.
  3. Ray Huang

    Ray Huang Everleap staff

    If you need actual markup, it should look something like this:

            <rule name="RedirectActualURL">
              <match url="^http://sitename\.com$" />
              <action type="Redirect" url="http://www.sitename.com" appendQueryString="false" />
    Martin Ortega likes this.
  4. Much thanks Ray! I added the above to my web.config and now both the regular URL and the el-alt.com URL work :)
    Martin Ortega and Ray Huang like this.

Share This Page