R
Roshawn
I'm using the free UrlRewriter.Net HttpModule to perform url rewrites on my website.
Well, sort of. The thing is, I can't get the rewrites to work.
After creating a configSection and adding the component to the httpModule section of my
web.config file, I began writing rules. Here's a sample of what I have:
<rewriter>
<rewrite url="~/Products/(.+)" to="~/Products/default.aspx?category=$1"/>
<rewrite url="~/Products/(.+)/(\d+)"
to="~/Products/default.aspx?category=$1&page=$2"/>
</rewriter>
While testing the first rule, everything works perfectly. The second rule, unfortunately,
screws up. Instead of having two querystring parameters, ASP.NET only sees one. For
example, suppose a customer had "~/Products/CDs/3" in their address bar. ASP.NET doesn't
see it as "~/Products/default.aspx?category=CDs&page=3" but rather views it as
"~/Products/default.aspx?category=CDs/3"
Why isn't this working? Is my use of regular expressions wrong (I'm not good at them)?
Please help.
Roshawn
Well, sort of. The thing is, I can't get the rewrites to work.
After creating a configSection and adding the component to the httpModule section of my
web.config file, I began writing rules. Here's a sample of what I have:
<rewriter>
<rewrite url="~/Products/(.+)" to="~/Products/default.aspx?category=$1"/>
<rewrite url="~/Products/(.+)/(\d+)"
to="~/Products/default.aspx?category=$1&page=$2"/>
</rewriter>
While testing the first rule, everything works perfectly. The second rule, unfortunately,
screws up. Instead of having two querystring parameters, ASP.NET only sees one. For
example, suppose a customer had "~/Products/CDs/3" in their address bar. ASP.NET doesn't
see it as "~/Products/default.aspx?category=CDs&page=3" but rather views it as
"~/Products/default.aspx?category=CDs/3"
Why isn't this working? Is my use of regular expressions wrong (I'm not good at them)?
Please help.
Roshawn