i'm building this asp.net application that require couple of subdomains. they will all share the same code base but i have separate .aspx for each subdomain in its own subfolder, as follows:
admin.domain.com -> domain.com/admin
user.domain.com -> domain.com/user
...
everything works great on my dev box (win7, iis 7.5) using the following rewrite rules:
<rule name="admin.domain.com" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^admin.domain.com$" />
<add input="{PATH_INFO}" pattern="^/images/" negate="true" />
<add input="{PATH_INFO}" pattern="^/handlers/" negate="true" />
<add input="{PATH_INFO}" pattern="^/aspnet_client/" negate="true" />
<add input="{PATH_INFO}" pattern="^/webservices/" negate="true" />
<add input="{URL}" pattern="\.axd$" negate="true" />
</conditions>
<action type="Rewrite" url="\admin\{R:0}" />
</rule>
When i push my release over to production, which runs Win 2008 R1, on IIS 7.0 the rewrites break. I see that my <form>
tag in source of the page points to action="admin/"
, whereas on 7.5 it points to root. So when i post my forms i get 404s, as there is no /admin subfolder per rewrites.
Is there anything i can do to remedy this? I would like to omit upgrading to R2 just to fix this. Can i upgrade URL Rewrite module alone? Can i fix this using different rewrite rule?
Any help is appreciated!