سؤال

Actually its the mono version of asp.net, XSP.

In my begin request function i check the url and rewrite when necessary. In one case i do

context.RewritePath("~/App_Data/public" + path);

When i try to request images or anything i get a 404 instead of the content. Why?

هل كانت مفيدة؟

المحلول 3

It looks like this isnt supported in mono ATM. HttpContext.Rewrite is but rewriting to files is not.

نصائح أخرى

Use Fiddler o see the actual request. If the path is being rewritten the images would probably have to referenced as an absolute path..

But alas I have no experince with xsp so ....

Use fiddler to see the actual request

Images by default don't get handled by ASP.NET (at least on IIS). Are you able to confirm that image extensions are being handled by ASP.NET and not being directly served up?

Also, modify the code slightly:

string newpath = "~/App_Data/public" + path;
context.RewritePath(newpath);

And check the value of newpath to make sure it's a well-formed path. If path is not prefixed with a path delimiter then that may also be the cause of your woes.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top