Subdomains

Posted by Community Admin on 03-Aug-2018 01:08

Subdomains

All Replies

Posted by Community Admin on 29-Jun-2011 00:00

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>

Posted by Community Admin on 04-Jul-2011 00:00

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

This thread is closed