views:

57

answers:

0

Hi have an issue with the rewrite mod for IIS7

I have several websites in this example (seasons.com. summer.com, winter.com, spring.com)

All of these domains point to the same folder (g:\websites\seasons\htdocs)

Now the complicated bit.

Summer.com gets rewritten to g:\websites\seasons\htdocs\domains\summer\ so any file in this folder would appear like http://www.summer.com/helloworld.php. This rewrite appears in the g:\websites\seasons\htdocs\web.config

Now summer.com also has its own rewrite rules contained in a web.config file located in g:\websites\seasons\htdocs\domains\summer\web.config

If a visitor attempts to visit http://summer.com/news/ the rewrite moudle rewrites should rewrite to the news.php file contained within the summer folder (g:\websites\seasons\htdocs\domains\summer\news.php) but instead it rewrites to

url: http://www.summer.com:80/domains/summer/news/ path: g:\websites\seasons\htdocs\domains\summer\news\

Here are the rewrite rules

The file located at g:\websites\seasons\htdocs\web.config

<rule name="summer">
  <match url="(.*)" />
  conditions logicalGrouping="MatchAny">
    <add input="{HTTP_HOST}" pattern="summer.com" />
  </conditions>
  <action type="Rewrite" url="/domains/summer/{R:0}" />
</rule>

the file located at g:\websites\seasons\htdcoc\domains\summer\web.config

<rule name="Rewrite to news">
  <match url="^news/" />
  <action type="Rewrite" url="news.php" />
</rule>

I know this isn't perfect. Any help appreciated