Пример #1
0
 private void ClearCache()
 {
     if (this.PortalId == Null.NullInteger)
     {
         DataCache.ClearHostCache(false);
     }
     else
     {
         DataCache.ClearPortalCache(this.PortalId, false);
     }
     CacheController.FlushPageIndexFromCache();
     CacheController.FlushFriendlyUrlSettingsFromCache();
 }
        public HttpResponseMessage UpdateRegexSettings(UpdateRegexSettingsRequest request)
        {
            try
            {
                List <KeyValuePair <string, string> > validationErrors = new List <KeyValuePair <string, string> >();
                if (!ValidateRegex(request.IgnoreRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("IgnoreRegex", Localization.GetString("ignoreRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.DoNotRewriteRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("DoNotRewriteRegex", Localization.GetString("doNotRewriteRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.UseSiteUrlsRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("UseSiteUrlsRegex", Localization.GetString("siteUrlsOnlyRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.DoNotRedirectRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("DoNotRedirectRegex", Localization.GetString("doNotRedirectUrlRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.DoNotRedirectSecureRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("DoNotRedirectSecureRegex", Localization.GetString("doNotRedirectHttpsUrlRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.ForceLowerCaseRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("ForceLowerCaseRegex", Localization.GetString("preventLowerCaseUrlRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.NoFriendlyUrlRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("NoFriendlyUrlRegex", Localization.GetString("doNotUseFriendlyUrlsRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.DoNotIncludeInPathRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("DoNotIncludeInPathRegex", Localization.GetString("keepInQueryStringRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.ValidExtensionlessUrlsRegex))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("ValidExtensionlessUrlsRegex", Localization.GetString("urlsWithNoExtensionRegExInvalidPattern", LocalResourcesFile)));
                }
                if (!ValidateRegex(request.RegexMatch))
                {
                    validationErrors.Add(new KeyValuePair <string, string>("RegexMatch", Localization.GetString("validFriendlyUrlRegExInvalidPattern", LocalResourcesFile)));
                }

                if (validationErrors.Count > 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, new { Success = false, Errors = validationErrors }));
                }
                else
                {
                    HostController.Instance.Update(FriendlyUrlSettings.IgnoreRegexSetting, request.IgnoreRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.DoNotRewriteRegExSetting,
                                                   request.DoNotRewriteRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.SiteUrlsOnlyRegexSetting,
                                                   request.UseSiteUrlsRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.DoNotRedirectUrlRegexSetting,
                                                   request.DoNotRedirectRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.DoNotRedirectHttpsUrlRegexSetting,
                                                   request.DoNotRedirectSecureRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.PreventLowerCaseUrlRegexSetting,
                                                   request.ForceLowerCaseRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.DoNotUseFriendlyUrlRegexSetting,
                                                   request.NoFriendlyUrlRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.KeepInQueryStringRegexSetting,
                                                   request.DoNotIncludeInPathRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.UrlsWithNoExtensionRegexSetting,
                                                   request.ValidExtensionlessUrlsRegex, false);
                    HostController.Instance.Update(FriendlyUrlSettings.ValidFriendlyUrlRegexSetting, request.RegexMatch,
                                                   false);

                    DataCache.ClearHostCache(false);
                    CacheController.FlushPageIndexFromCache();
                    CacheController.FlushFriendlyUrlSettingsFromCache();

                    return(Request.CreateResponse(HttpStatusCode.OK, new { Success = true }));
                }
            }
            catch (Exception exc)
            {
                Logger.Error(exc);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc));
            }
        }
Пример #3
0
        public HttpResponseMessage SaveHostSettings(WebAPI.Models.FriendlyUrlSettings dto)
        {
            try
            {
                // AUM_AutoAsciiConvert
                HostController.Instance.Update(FriendlyUrlSettings.AutoAsciiConvertSetting, dto.auto_ascii_convert.ToString(), true);

                // AUM_CheckForDuplicatedUrls
                HostController.Instance.Update(FriendlyUrlSettings.CheckForDuplicatedUrlsSetting, dto.check_for_duplicate_urls.ToString(), true);

                // AUM_DeletedTabHandlingType
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.DeletedTabHandlingTypeSetting, dto.deleted_tab_handling, true);

                // AUM_KeepInQueryStringRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.KeepInQueryStringRegexSetting, dto.do_not_include_in_path_regex, true);

                // AUM_DoNotRedirectUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.DoNotRedirectUrlRegexSetting, dto.do_not_redirect_regex, true);

                // AUM_DoNotRedirectHttpsUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.DoNotRedirectHttpsUrlRegexSetting, dto.do_not_redirect_secure_regex, true);

                // AUM_DoNotRewriteRegEx
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.DoNotRewriteRegExSetting, dto.do_not_rewrite_regex, true);

                // AUM_EnableCustomProviders
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.EnableCustomProvidersSetting, dto.enable_custom_providers.ToString(), true);

                // AUM_ForceLowerCase
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.ForceLowerCaseSetting, dto.force_lower_case.ToString(), true);

                // AUM_PreventLowerCaseUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.PreventLowerCaseUrlRegexSetting, dto.force_lower_case_regex, true);

                // AUM_IgnoreUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.IgnoreRegexSetting, dto.ignore_regex, true);

                // AUM_LogCacheMessages
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.LogCacheMessagesSetting, dto.log_cache_messages.ToString(), true);

                // AUM_DoNotUseFriendlyUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.DoNotUseFriendlyUrlRegexSetting, dto.no_friendly_url_regex, true);

                // AUM_PageExtension
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.PageExtensionSetting, dto.page_extension, true);

                // AUM_PageExtensionUsage
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.PageExtensionUsageSetting, dto.page_extension_usage, true);

                // AUM_RedirectOldProfileUrl
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.RedirectOldProfileUrlSetting, dto.redirect_old_profile_url.ToString(), true);

                // AUM_RedirectUnfriendly
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.RedirectUnfriendlySetting, dto.redirect_unfriendly.ToString(), true);

                // AUM_RedirectMixedCase
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.RedirectMixedCaseSetting, dto.redirect_wrong_case.ToString(), true);

                // AUM_ValidFriendlyUrlRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.ValidFriendlyUrlRegexSetting, dto.regex_match, true);

                // AUM_ReplaceChars
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.ReplaceCharsSetting, dto.replace_chars, true);

                // AUM_ReplaceCharWithChar
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.ReplaceCharWithCharSetting, dto.replace_char_with_char, true);

                // AUM_ReplaceSpaceWith
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.ReplaceSpaceWithSetting, dto.replace_space_with, true);

                // AUM_SSLClientRedirect
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.SslClientRedirectSetting, dto.ssl_client_redirect.ToString(), true);

                // AUM_UrlFormat
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.UrlFormatSetting, dto.url_format, true);

                // AUM_SiteUrlsOnlyRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.SiteUrlsOnlyRegexSetting, dto.use_site_urls_regex, true);

                // AUM_UrlsWithNoExtensionRegex
                HostController.Instance.Update(DotNetNuke.Entities.Urls.FriendlyUrlSettings.UrlsWithNoExtensionRegexSetting, dto.valid_extensionless_urls_regex, true);

                CacheController.FlushFriendlyUrlSettingsFromCache();
                CacheController.FlushPageIndexFromCache();

                Config.Touch();

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex));
            }
        }
        private void Save()
        {
            try
            {
                var portalController = new PortalController();
                var portal           = portalController.GetPortal(PortalId, SelectedCultureCode);

                // AUM_UrlFormat
                //if (cbURLFormat.Checked)
                //{
                //    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.UrlFormatSetting, UrlFormatType.Advanced.ToString().ToLower());
                //}
                //else
                //{
                //    DotNetNuke.Entities.Portals.PortalController.DeletePortalSetting(PortalId, FriendlyUrlSettings.UrlFormatSetting);
                //}

                // AUM_DeletedTabHandlingType
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.DeletedTabHandlingTypeSetting, rblDeletedTabHandlingType.SelectedValue);

                // AUM_ErrorPage404
                // pre 7.2.2.
                //DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ErrorPage404Setting, ddlErrorPage404.SelectedItemValueAsInt.ToString());
                //7.2.2+
                portal.Custom404TabId = ddlErrorPage404.SelectedItemValueAsInt;

                // AUM_ErrorPage500
                // pre 7.2.2.
                //DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ErrorPage500Setting, ddlErrorPage500.SelectedItemValueAsInt.ToString());
                portal.Custom500TabId = ddlErrorPage500.SelectedItemValueAsInt;

                portalController.UpdatePortalInfo(portal);

                // AUM_ForceLowerCase
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ForceLowerCaseSetting, cbForceLowerCase.Checked.ToString());

                // AUM_PageExtension
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.PageExtensionSetting, txtPageExtension.Text);

                // AUM_PageExtensionUsage
                if (!cbPageExtensionHandling.Checked)
                {
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.PageExtensionUsageSetting, DotNetNuke.Entities.Urls.PageExtensionUsageType.AlwaysUse.ToString());
                }
                else
                {
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.PageExtensionUsageSetting, DotNetNuke.Entities.Urls.PageExtensionUsageType.Never.ToString());
                }

                // AUM_RedirectOldProfileUrl
                // AUM_RedirectUnfriendly
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.RedirectUnfriendlySetting, cbRedirectUnfriendly.Checked.ToString());

                // AUM_ReplaceSpaceWith, // AUM_ReplaceChars, // AUM_ReplaceCharWithChar
                if (cbCharacterReplacement.Checked)
                {
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ReplaceSpaceWithSetting, ddlReplaceSpaceWith.SelectedValue);
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ReplaceCharsSetting, txtReplaceChars.Text);
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ReplaceCharWithCharSetting, txtFindReplaceTheseCharacters.Text);
                }
                else
                {
                    DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ReplaceSpaceWithSetting, FriendlyUrlSettings.ReplaceSpaceWithNothing);
                    DotNetNuke.Entities.Portals.PortalController.DeletePortalSetting(PortalId, FriendlyUrlSettings.ReplaceCharsSetting);
                    DotNetNuke.Entities.Portals.PortalController.DeletePortalSetting(PortalId, FriendlyUrlSettings.ReplaceCharWithCharSetting);
                }

                // AUM_RedirectMixedCase
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.RedirectMixedCaseSetting, cbRedirectMixedCase.Checked.ToString());

                // AUM_SpaceEncodingValue
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.SpaceEncodingValueSetting, rblSpaceEncodingValue.SelectedValue);

                // AUM_AutoAsciiConvert
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.AutoAsciiConvertSetting, cbAutoAsciiConvert.Checked.ToString());

                // AUM_CheckForDuplicatedUrls
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.CheckForDuplicatedUrlsSetting, cbCheckForDuplicatedUrls.Checked.ToString());

                // AUM_FriendlyAdminHostUrls - skip

                // AUM_EnableCustomProviders
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.EnableCustomProvidersSetting, cbEnableCustomProviders.Checked.ToString());

                // AUM_IgnoreUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.IgnoreRegexSetting, txtIgnoreUrlRegex.Text);

                // AUM_DoNotRewriteRegEx
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.DoNotRewriteRegExSetting, txtDoNotRewriteRegEx.Text);

                // AUM_SiteUrlsOnlyRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.SiteUrlsOnlyRegexSetting, txtSiteUrlsOnlyRegex.Text);

                // AUM_DoNotRedirectUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.DoNotRedirectUrlRegexSetting, txtDoNotRedirectUrlRegex.Text);

                // AUM_DoNotRedirectHttpsUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.DoNotRedirectHttpsUrlRegexSetting, txtDoNotRedirectHttpsUrlRegex.Text);

                // AUM_PreventLowerCaseUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.PreventLowerCaseUrlRegexSetting, txtPreventLowerCaseUrlRegex.Text);

                // AUM_DoNotUseFriendlyUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.DoNotUseFriendlyUrlRegexSetting, txtDoNotUseFriendlyUrlRegex.Text);

                // AUM_KeepInQueryStringRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.KeepInQueryStringRegexSetting, txtKeepInQueryStringRegex.Text);

                // AUM_UrlsWithNoExtensionRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.UrlsWithNoExtensionRegexSetting, txtUrlsWithNoExtensionRegex.Text);

                // AUM_ValidFriendlyUrlRegex
                DotNetNuke.Entities.Portals.PortalController.UpdatePortalSetting(PortalId, FriendlyUrlSettings.ValidFriendlyUrlRegexSetting, txtValidFriendlyUrlRegex.Text);

                // AUM_UsePortalDefaultLanguage
                // AUM_AllowDebugCode
                // AUM_LogCacheMessages

                CacheController.FlushFriendlyUrlSettingsFromCache();
                CacheController.FlushPageIndexFromCache();
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Пример #5
0
        public HttpResponseMessage ClearPortalSettings()
        {
            try
            {
                int portal_id = this.PortalSettings.PortalId;

                // AUM_AutoAsciiConvert
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.AutoAsciiConvertSetting, string.Empty, true);

                // AUM_CheckForDuplicatedUrls
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.CheckForDuplicatedUrlsSetting, string.Empty, true);

                // AUM_DeletedTabHandlingType
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.DeletedTabHandlingTypeSetting, string.Empty, true);

                // AUM_KeepInQueryStringRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.KeepInQueryStringRegexSetting, string.Empty, true);

                // AUM_DoNotRedirectUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.DoNotRedirectUrlRegexSetting, string.Empty, true);

                // AUM_DoNotRedirectHttpsUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.DoNotRedirectHttpsUrlRegexSetting, string.Empty, true);

                // AUM_DoNotRewriteRegEx
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.DoNotRewriteRegExSetting, string.Empty, true);

                // AUM_EnableCustomProviders
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.EnableCustomProvidersSetting, string.Empty, true);

                // AUM_ForceLowerCase
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.ForceLowerCaseSetting, string.Empty, true);

                // AUM_PreventLowerCaseUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.PreventLowerCaseUrlRegexSetting, string.Empty, true);

                // AUM_IgnoreUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.IgnoreRegexSetting, string.Empty, true);

                // AUM_LogCacheMessages
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.LogCacheMessagesSetting, string.Empty, true);

                // AUM_DoNotUseFriendlyUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.DoNotUseFriendlyUrlRegexSetting, string.Empty, true);

                // AUM_PageExtension
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.PageExtensionSetting, string.Empty, true);

                // AUM_PageExtensionUsage
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.PageExtensionUsageSetting, string.Empty, true);

                // AUM_RedirectOldProfileUrl
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.RedirectOldProfileUrlSetting, string.Empty, true);

                // AUM_RedirectUnfriendly
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.RedirectUnfriendlySetting, string.Empty, true);

                // AUM_RedirectMixedCase
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.RedirectMixedCaseSetting, string.Empty, true);

                // AUM_ValidFriendlyUrlRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.ValidFriendlyUrlRegexSetting, string.Empty, true);

                // AUM_ReplaceChars
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.ReplaceCharsSetting, string.Empty, true);

                // AUM_ReplaceCharWithChar
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.ReplaceCharWithCharSetting, string.Empty, true);

                // AUM_ReplaceSpaceWith
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.ReplaceSpaceWithSetting, string.Empty, true);

                // AUM_SSLClientRedirect
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.SslClientRedirectSetting, string.Empty, true);

                // AUM_UrlFormat
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.UrlFormatSetting, string.Empty, true);

                // AUM_SiteUrlsOnlyRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.SiteUrlsOnlyRegexSetting, string.Empty, true);

                // AUM_UrlsWithNoExtensionRegex
                PortalController.UpdatePortalSetting(portal_id, FriendlyUrlSettings.UrlsWithNoExtensionRegexSetting, string.Empty, true);


                CacheController.FlushFriendlyUrlSettingsFromCache();
                CacheController.FlushPageIndexFromCache();

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex));
            }
        }