sflb.ashx to file mimetype

Posted by Community Admin on 03-Aug-2018 15:21

sflb.ashx to file mimetype

All Replies

Posted by Community Admin on 18-Jan-2011 00:00

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

Posted by Community Admin on 19-Jan-2011 00:00

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();
    
 

You can place your module before SitefinityHttpModule in the web.config.

Hope this is helpful.

Best wishes,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed