Question: I have big issue with url-rewriting for IIS 7.0.

I've written simple module for rewriting for my NET3.5/IIS7 web application. Here is a part of the code.

```
    public void Init(HttpApplication context)
    {
        context.BeginRequest += new EventHandler(context_BeginRequest);
    }

    void context_BeginRequest(object sender, EventArgs e)
    {
        HttpApplication app = sender as HttpApplication;
        if (app.Request.Path.Contains("pagetorewrite.aspx"))
            HttpContext.Current.RewritePath("~/otherpage.aspx");
    }

```

And I register my module in web.config :

```
  <system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
              <add name="MyModule" type="MyModule" preCondition="" />

```

Under IIS 7.0 (Vista) using Classic ASP Pipeline it works perfect, but when I change pipeline mode to Integrated, then it stops working. There are no exceptions, errors and anything in debugger/events/logfiles - only message in a browser that page was not found. The stragnest thing is that pagename looks like mispelled or merged from parts of original page and rewrte-to page.

I've deployed my code at another computer (also vista -but x64- and iis 7.0) and it works perfect in both modes.
It looks that there's an configuration issue or what?

Answer: 
I think

```
target="(name=myDictionary)"

```

should do the trick in the `@scr.reference` annotation. See <http://felix.apache.org/site/apache-felix-maven-scr-plugin.html>
In standard DS, you can use target attribute of the reference element. In Felix world, where annotations can be used, I don't know what is the equivalent.

The target attribute is an LDAP filter, which matches against the service properties. So, your filter should be:

`(name=myDictionary)`