views:

23

answers:

0

http://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/

I have a website hosted at www.hostedsite.com/here, and need to use the subdomain foo.bar.com. The issue im having is when you navigate using any of the links, the url changes to foo.bar.com/here/whatever with 'here' being the folder name coming through. I was hoping I could use the IIS7 Rewrite Module to rewrite the url to foo.bar.com/whatever and remove that /here/ folder name.

I'm having trouble understanding this article, because visual studio doesn't like when I drop this snippet into my web.config file in the root of my project, complaining it doesn't recognize the rewrite tag.

<rewrite>
    <rewriteMaps>
        <rewriteMap name="StaticRewrites">
            <add key="/article1" value="/article.aspx?id=1&amp;title=some-title" />
            <add key="/some-title" value="/article.aspx?id=1&amp;title=some-title" />
            <add key="/post/some-title.html" value="/article.aspx?id=1&amp;title=some-title" />
        </rewriteMap>
    </rewriteMaps>
    <rules>
        <rule name="Rewrite Rule 1 for StaticRewrites" stopProcessing="true">
            <match url=".*" />
            <conditions>
                <add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)" />
            </conditions>
            <action type="Rewrite" url="{C:1}" appendQueryString="False"/>
        </rule>
    </rules>
</rewrite>

How do I use the IIS7 Rewrite Module manually to rewrite "foo.bar.com/folder/whatever" to "foo.bar.com/whatever", by adding entries into a web.config file somewhere if I don't have access to the IIS Interface through my hosting provider. (if I do, I have no idea how to get there) Your help is greatly appreciated.