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="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^www\.sitename\.com$" negate="true" />
    </conditions>
    <action type="Redirect" url="http://www.sitename.com/{R:1}" />
    </rule>

    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:

    Code:
            <rule name="RedirectActualURL">
              <match url="^http://sitename\.com$" />
              <action type="Redirect" url="http://www.sitename.com" appendQueryString="false" />
            </rule>
    
     
    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