1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Subdomains

Subdomains

2 posts, 0 answered
  1. Byzza
    Byzza avatar
    89 posts
    Registered:
    09 Jul 2007
    29 Jun 2011
    Link to this post
    Ok, So I've read quite a few threads on here, as well as a lot of help on other forums about the IIS rewrite, and I think I'm on the right track, but I still can't get it write.

    So I have 1 site -> www.site.com
    and I just want --> sub1.site.com & sub2.site.com to point too --> www.site.com/sub1 or www.site.com/sub2

    not that is the easy part, the problem now is if you visit sub1.site.com  the images, scirpts, css are all trying to load from:
    www.site.com/sub1/images instead of www.site.com/images

    can someone help please
    This is my last attempt
    <rewrite>
        <rules>
            <clear />
            <rule name="Folders" enabled="true" stopProcessing="true">
                <match url=".*/(.*)" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.bradken\.com|\.au$" />
                </conditions>
                <action type="Rewrite" url="http://bradken.com/{R:1}" />
            </rule>
            <rule name="SubDomain" enabled="true" stopProcessing="true">
                <match url="(.*)" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.bradken\.com|\.au$" />
                </conditions>
                <action type="Rewrite" url="{C:1}/{R:1}" />
            </rule>
        </rules>
    </rewrite>

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Jul 2011
    Link to this post
    Hi Byzza,

    The thing is that your rule matches all requests, which is not what you want. Since all of your static files (CSS, JS, and embedded web resources) are not located on the path you are rewriting to. Your rules should exclude urls with .css, .js, .axd, extensions. As a matter of fact you should only rewrite the requests for pages (they are either extensionless or may have extension (.aspx, .html) if you are using additional urls or external pages).

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered