Hi guys
I have a web app I'm developing in C#. I have a UrlRewrite HTTP Handler,
which seems to work, apart from when I ask it to do something if NOT.
Here's the directory structure...
/default.aspx
/gallery/default.aspx
/gallery/viewartist.aspx
On the main page, I have a link to the gallery section which links to
"/gallery/". From there, I have a number of fake links to artists, e.g.
"/gallery/artist1/", "/gallery/artist2/", etc
The idea is to use URL rewriting to forward those fake links to
"viewartist?artist_id=artist1"
But I still want links to "/gallery/" to work.
Here's the code...
if (url.Contains("/gallery/"))
{
if (url.EndsWith("/gallery/") != true)
waveApp.Context.RewritePath(ConfigurationManager.A ppSettings["BaseUrl"] +
"gallery/viewartist.aspx");
}
I don't handle the /gallery/ option, because it has a default.aspx, so
that's sorted.
The problem is, as I've got the code now, it ALWAYS goes to viewartist.aspx.
You can never get to /gallery/default.aspx.
Can someone explain why if (url.EndsWith("/gallery/") != true) seems to get
ignored, and the waveApp.Context.Rewrite... always gets fired?!
Thanks, Dan.