0

I am using a scheduled job that moves outdated events to a folder called "Past events". After the event have been moved, I want to change the event page's url from its old one to the new so it matches the hierarchy of its new location. For this, I am using a custom redirect gadget called BVN.404Handler.

if(Configuration.Logging == LoggerMode.On && Upgrader.Valid)
        {
            Logger.LogRequest(urlNotFound, referer);
        }

The line of code above only logs a suggestion of the old url and the new one. Since this is a scheduled job that moves pages based on their endDate value i need to make the redirect gadget register the url mappings automatically. With the current solution, a user needs to manually open the gadget and confirm the mapping by pasting the newurl (known referrers) value into the textfield and pressing "Add".

This is what it looks like: Image of BVN.404Handler gadget

Is this possible to achieve with the current version of this gadget?

  <package id="BVN.404Handler" version="3.1.2" targetFramework="net45" 

Or do anyone know a possible workaround for achieving this?

Thanks in advance / Carl

dont_trust_me
  • 540
  • 8
  • 24
  • The BVN.404 stores the redirects in a very simple sql table, it seems as a perfectly fine solution to perform your CRUD operations directly to that table. – Eric Herlitz Jul 10 '15 at 07:39

1 Answers1

0

This is code fragment that Gadget uses itself to store custom redirect:

new DataStoreHandler().SaveCustomRedirect(
    new CustomRedirect(oldUrl.Trim(),
                       newUrl.Trim(),
                       (skipWildCardAppend == null) ? false : true));

You can give it a try and fill in with your own required data.