301 Redirect to Site Home Page Option Not Working

Apr 16, 2015 at 8:29 PM
Hi there, I've been using this extension for a few months and it's been working just fine.

However, I now need to use the "301 Redirect Deleted, Expired, Disabled Page to Site Home Page" option. When I check it and click update, the setting does not stick. It always goes right back to the "Show 404 Error" option.

Image

Also, I looked in the PortalSettings table, and could not find a setting that looked like it would go with this option.

Any help would be greatly appreciated!
Coordinator
Apr 17, 2015 at 3:51 PM
You're right. The setting name is AUM_DeletedTabHandlingType and can be found in both the PortalSettings and HostSettings table. However, neither seems to be affecting the selection. I am simply polling the DotNetNuke.Entities.Urls.FriendlyUrlSettings object to get the values so I suspect DNN is populating that object some other way. I need to dig in to figure out where. I suspect this is a bug with how that object gets populated within DNN.
Coordinator
Apr 17, 2015 at 4:07 PM
Ok I figured it out. DNN was expecting to have the sting literal value stored in the database instead of the int value of the enum for those options. Odd. I fixed the UX to store and retrieve the setting as DNN expects. Although I would kind of expect this should the int value instead of the string literal so there is chance this gets broken in some future version of DNN.
Apr 17, 2015 at 4:10 PM
Thanks for taking a look. Great module btw!

Do you happen to know what the SettingValue for redirecting to site home page would be? I tried '1', but it doesn't appear to make any difference.
Coordinator
Apr 17, 2015 at 4:19 PM
    public DeletedTabHandlingType DeletedTabHandlingType
    {
        get
        {
            DeletedTabHandlingType val;
            switch (_deletedTabHandling.ToLower())
            {
                case "do301redirecttoportalhome":
                    val = DeletedTabHandlingType.Do301RedirectToPortalHome;
                    break;
                default:
                    val = DeletedTabHandlingType.Do404Error;
                    break;
            }
            return val;
        }
        set
        {
            string newValue = value.ToString();
            _deletedTabHandling = newValue;
        }
    }

So, it is expecting the value "do301redirecttoportalhome" for the 301, anything else gets the 404

I've updated the module UX accordingly. New version 15.4.17
Marked as answer by jmathis on 4/17/2015 at 8:20 AM
Apr 17, 2015 at 8:12 PM
It works! Thank you.

A question though...

Now that I think about it, I'm not sure if this option would be wise for general use. What if I need to re-enable, or undelete a page? Wouldn't a 301 to the homepage keep anyone from getting back to the url permanently, even after the page is undeleted or re-enabled?
Coordinator
Apr 17, 2015 at 9:39 PM
You may be right. The module just enables the option. It's up to the this user to decide if it's right for their use case.