Possible to use URL rewrites for subdomains in EverLeap

Discussion in 'General troubleshooting' started by JTNichols, Dec 5, 2014.

  1. Hello,
    In my discountASP site I use IIS Manager to rewrite URLs to point to subfolders, i.e. I enable root/subFolder1 as an application and use IIS to rewrite the request:
    mySite.com --> mySite.com/subfolder1

    I believe I read somewhere on this forum that EL doesn't allow you to connect with IIS Manager, but does it allow you to do the same thing by using web.config?

    This blog describes it, http://weblogs.asp.net/owscott/iis-url-rewrite-hosting-multiple-domains-under-one-site

    I did a test myself (below) which isn't working, after a couple hours trouble shooting I'm not certain if I have a typo or if EL's architecture is preventing it.

    <rewrite>
    <rules>
    <rulename="subFolder1"stopProcessing="true">
    <matchurl=".*"/>
    <conditions>
    <addinput="{HTTP_HOST}"pattern="^(www.)?myEverLeapAltURL.el-alt.com"/>
    <!--<addinput="{PATH_INFO}"pattern="^/subFolder1/"negate="true"/> -->
    </conditions>
    <actiontype="Rewrite"url="\subFolder1\{R:0}"/>
    </rule>
    </rules>
    </rewrite>
     
  2. I tested the rewrite as specified in the blog, and it works. Are you adding the rewrites to the web.config in the root folder?
     
  3. Aristotle,
    That was it. In my discountASP.net account I had it in the root, but I was trying to put it in the subfolder here, forgot that it wouldn't be hit there. Thank You!
    This was my last 'gotta have it' feature, definitely going to move over to EverLeap. Thanks again!
     
    mjp likes this.
  4. I have a similar problem. In my case the web.config works fine for all http requests but is not working as expected https requests.
    i.e. for all http calls it goes to domain.mydomain.com/abc.aspx but if it is a https then it shows https://mydomain.com/demo/abc.aspx in the address bar. How can I get it to redirect it to https://demo.mydomain.com/abc.aspx?

    Here's my web.config
    <rewrite>
    <rules>
    <rule name="demo.mydomain.com" stopProcessing="true">
    <match url=".*" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^demo.mydomain.com$" />
    <add input="{PATH_INFO}" pattern="^/demo/" negate="true" />
    </conditions>
    <action type="Rewrite" url="\demo\{R:0}" />
    </rule>
    </rules>
    </rewrite>
     
  5. Frankc

    Frankc Everleap staff

    are you using SNI SSL or unique IP ssl?

    What error are you getting? or it just doesn't redirect properly.
     
  6. Do you want a redirect or a rewrite? They are two different things. Your example is a rewrite and not a redirect. The rewrite rule that you have will do the following:

    If the user goes to http or https://demo.mydomain.com/abc.aspx, it will show the page at /demo/abc.aspx.

    So your links to the pages must have demo.mydomain.com in the first place. It does not do redirects from www.mydomain.com to demo.mydomain.com.
     
  7. I need a rewrite only and not redirect. My links are not hardcoded but relative. Everything works fine for the http links but for the https links it creates a problem.

    Please take a look at http://demo.basebypros.com/ to see what I mean. If you click on any of the links, most of the links will work as expected but if you click on any of the secure links like login or sign up, you'll see what I mean.

    I wanted to set it up as a demo and everything is fine if I don't use the secure feature using web.config i.e. by setting <add key="RequireSSL" value="false" />. So, my problem is solved for now but it'll be good to know what is causing this redirection.
     
  8. It's doesn't look like an issue with the rewrite rule. The application is probably doing the redirects when it's HTTPS. You'll have to go through it's code to pinpoint where it's doing the redirect.
     
  9. Ah...OK. Thanks for the pointer. I will check it out.
     

Share This Page