sflb.ashx to file mimetype
Hi,
We are currently in the process of upgrading our Sitefinity 3.7 based website to 4.0 and have found that the extension sflb.ashx no longer exists in 4.0. Meaning that all static links to all files that were in Libraries now no longer point to their intended files, ie images referenced in the CSS.
I was just wondering if you had any short winded suggestions on how to get around this issue?
Thanks,
Louis
Hi Louis Farrell,
Are you using this migration tool?
Actually, no matter if you use it or not, my suggestion is to implement your own custom HttpModule, which will handle the old links and redirect (with permanent redirect) them to the new ones. For example:
public
class
BackwardHttpModule : IHttpModule
public
void
Dispose()
public
void
Init(HttpApplication context)
context.BeginRequest +=
new
EventHandler(context_BeginRequest);
void
context_BeginRequest(
object
sender, EventArgs e)
HttpContext context = ((HttpApplication)sender).Context;
if
(context.Request.RawUrl.EndsWith(
"sflb.ashx"
))
// Find the new item URL and redirect to it
protected
void
Redirect(
string
url)
HttpResponse response = HttpContext.Current.Response;
response.Status =
"301 Moved Permanently"
;
response.AddHeader(
"Location"
, url);
response.End();