D
David
Hi all,
Using C#.NET 1.1
I am progressing on my URL ReWriting quite well, but have a slight problem.
My server will not have real paths, just virtual, which is generated from a
database. This will include images, documents etc. (The images will map (URL
ReWrite) to real images of a different name.)
I am using the IIS 404 error to redirect to an ASPX page, which will then
allow my system to handle everything that does not exist on the file system.
This is working fantastically, though I do have a slight niggle with it.
If I call a virtual image (i.e. I don't have the real file, but I will URL
ReWrite to the correct image), my 404 handler gets called (this is what I
expect). As the handler is .ASPX, my URL ReWrite code in global.asax.cs gets
called. (Again, this is what I expect). I then rewrite the call to the image
to the real image that will be displayed. (This again is working like a
dream). However, what I didn't expect is the 404 handler page (even though
it doesn't actually get hit) is recorded in the web log files as the
requested item.
Trying to resolve this, I have passed the URL Rewriter to call the 404 page
direct and pass a parameter in the querystring. In my 404 page, I do a
response.redirect to the image that I want. This sort of works, but I get
the 404 page with a 304 response AND the rewritten image recorded in the log
files. I can live with the rewritten image (not the called image name) but I
don't want the 404 page to show up in my logs.
So, I tried a server.transfer inside the 404 page. This shows the image, but
it records the 404 page in the logs.
I am looking for ideas as to how to get around this problem.
In summary...
If I call an image (which needs to be URL ReWritten), I want the image to be
recorded in the log. This works fine if I call aspx pages (though not yet
tried it for classic asp, but really, I am not so interested in that at the
moment).
Any ideas?
BTW. I cannot do anything that will need to be installed on a server. This
has to be copy and paste deployment (i.e. can be run on a shared server at
an ISP.), so has to be handled within .NET.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Using C#.NET 1.1
I am progressing on my URL ReWriting quite well, but have a slight problem.
My server will not have real paths, just virtual, which is generated from a
database. This will include images, documents etc. (The images will map (URL
ReWrite) to real images of a different name.)
I am using the IIS 404 error to redirect to an ASPX page, which will then
allow my system to handle everything that does not exist on the file system.
This is working fantastically, though I do have a slight niggle with it.
If I call a virtual image (i.e. I don't have the real file, but I will URL
ReWrite to the correct image), my 404 handler gets called (this is what I
expect). As the handler is .ASPX, my URL ReWrite code in global.asax.cs gets
called. (Again, this is what I expect). I then rewrite the call to the image
to the real image that will be displayed. (This again is working like a
dream). However, what I didn't expect is the 404 handler page (even though
it doesn't actually get hit) is recorded in the web log files as the
requested item.
Trying to resolve this, I have passed the URL Rewriter to call the 404 page
direct and pass a parameter in the querystring. In my 404 page, I do a
response.redirect to the image that I want. This sort of works, but I get
the 404 page with a 304 response AND the rewritten image recorded in the log
files. I can live with the rewritten image (not the called image name) but I
don't want the 404 page to show up in my logs.
So, I tried a server.transfer inside the 404 page. This shows the image, but
it records the 404 page in the logs.
I am looking for ideas as to how to get around this problem.
In summary...
If I call an image (which needs to be URL ReWritten), I want the image to be
recorded in the log. This works fine if I call aspx pages (though not yet
tried it for classic asp, but really, I am not so interested in that at the
moment).
Any ideas?
BTW. I cannot do anything that will need to be installed on a server. This
has to be copy and paste deployment (i.e. can be run on a shared server at
an ISP.), so has to be handled within .NET.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available