Hi, i am messing around with making a custom URL provider.
I have read the PDF about making custom url providers and have made this so far:
[AddInName("Image Alias Redirect"), AddInDescription("alias to image name redirect mapper"), AddInActive(true), AddInAuthor("test A/S"), AddInGroup("test")]
public class CustomUrlProvider : UrlProvider
{
public override List<Mapping> GetMappings()
{
List<Mapping> mappings = new List<Mapping>();
mappings = GetAliasImageMapping(mappings);
return mappings;
}
public List<Mapping> GetAliasImageMapping( List<Mapping> mappings )
{
// Some worker class that fetches a list of mappings
Mapping testMap = new Mapping("test", "test", "rewrittentest");
mappings.Add(testMap);
return mappings;
}
}
So far i am able to make it activate on somewebsite.local/Default.aspx?test=test. However i seem to be unable to have it activate on for instance products.aspx, getImage or just in general.
The way i understood it, the custom url provider just maps what params and corresponding values must be rewritten to some other url. In the provder you cannot specify if it should activate off of default.aspx or whatever comes before the first set of params.
So does it only work off of default.aspx ? ,or have i misunderstood something because i cannot seem to make it rewrite a url with test=test unless default.aspx comes before the params.