Try our conversational search powered by Generative AI!

Does Verndale Redirect Manager work with CMS 12?

Vote:
 

Does Verndale Redirect Manager work with CMS 12? if not what plugin is a good substitute to use with CMS 12?

I am seeing this error in the backend:

System.InvalidOperationException: No policy found: episerver:redirectmanager.
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, String policyName)
   at EPiServer.Shell.Web.Internal.NavigationService.IsAvailableAsync(MenuNode node)
   at EPiServer.Shell.Web.Internal.NavigationService.GetProductMenuItemsAsync(String productId)+MoveNext()
   at EPiServer.Shell.Web.Internal.NavigationService.GetProductMenuItemsAsync(String productId)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at EPiServer.Shell.UI.Controllers.Internal.EPiPlatformNavigationController.Get(String product, String parentProduct)
   at lambda_method512(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at QDX.Business.Services.HttpExceptionMiddleware.Invoke(HttpContext context) in C:\Users\dsingh\source\repos\QDX\QDX\Business\Services\HttpExceptionMiddleware.cs:line 25
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at QDX.Startup.<>c.<<Configure>b__6_1>d.MoveNext() in C:\Users\dsingh\source\repos\QDX\QDX\Startup.cs:line 225
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
'iisexpress.exe' (CoreCLR: clrhost): Loaded 'Microsoft.GeneratedCode'. 
Exception thrown: 'System.IO.DirectoryNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.DirectoryNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.DirectoryNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.DirectoryNotFoundException' in System.Private.CoreLib.dll
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: Error: An unhandled exception has occurred while executing the request.

#297129
Feb 24, 2023 7:48
Vote:
 

Hi Daman 

It seems the module is using a custom authorisation policy episerver:redirectmanager which hasn't been defined. You can either add this policy in your startup.cs or remove the policy from the module.config file in the module directory so that the default episerver:defaultshellmodule policy is applied.

#297133
Feb 24, 2023 11:49
Vote:
 

To your question about alternative plugins, https://github.com/Geta/geta-notfoundhandler is also a popular plugin that works with CMS 12.

#297134
Feb 24, 2023 11:55
Vote:
 

I installed the NuGet 

 Install-Package Geta.NotFoundHandler.Optimizely

 and added the following 

 services.AddHttpContextAccessor();

            services.AddOptimizelyNotFoundHandler(o =>
            {
                o.AutomaticRedirectsEnabled = true;
            });

            services.Configure<TinyMceConfiguration>(config =>
            {
                config.Default()
                      .AddEpiserverSupport()
                      .AddPlugin("epi-link code")
                      .AppendToolbar("epi-link | code");
            });


          

But I get this error when I start the application:

An unhandled exception of type 'System.InvalidOperationException' occurred in System.Private.CoreLib.dll
Unable to resolve service for type 'Geta.NotFoundHandler.Core.Redirects.IRedirectsService' while attempting to activate 'Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.DefaultAutomaticRedirectsService'.

#297165
Feb 24, 2023 20:07
Vote:
 

Assuming you applied all the other configuration steps, does it work if you remove the AutomaticRedirectsEnabled flag?

Mandatory configuration for CMS, as per as per https://github.com/Geta/geta-notfoundhandler#configuration

    services.AddNotFoundHandler(o =>
    {
        o.UseSqlServer(connectionstring);
        o.BufferSize = 30;
        o.ThreshHold = 5;
        o.HandlerMode = FileNotFoundMode.On;
        o.IgnoredResourceExtensions = new[] { "jpg", "gif", "png", "css", "js", "ico", "swf", "woff" };
        o.Logging = LoggerMode.On;
        o.LogWithHostname = false;
        o.AddProvider<NullNotFoundHandlerProvider>();
    });

    services.AddOptimizelyNotFoundHandler(o =>
    {
        o.AutomaticRedirectsEnabled = true;
    });

And,

public void Configure(IApplicationBuilder app)
{
    app.UseNotFoundHandler();
    app.UseOptimizelyNotFoundHandler();
...
}
#297251
Feb 26, 2023 22:55
Vote:
 

It works without errors, and I imported redirects but the redirects don't seem to be working

Ran the job successfully also:

the redirect is not working

#297297
Feb 27, 2023 7:46
Vote:
 

Could you try URLs without hostname and port?

Old URL:

/sn5training/

New URL:

/en/service-support/

#297305
Feb 27, 2023 9:25
Vote:
 

Also, make sure that 

 app.UseNotFoundHandler();
 app.UseOptimizelyNotFoundHandler();

are on top of the other `Use` method calls in the `Configure` method.

#297306
Feb 27, 2023 9:27
Vote:
 

Maris Krivtezs: The redirect does not work, do I need to run the job everytime I enter a redirect? Also, the redirects cannot be edited right? Just added or deleted?

here it is in configure services code:

Then in 

here is the redirect

#297342
Feb 27, 2023 18:57
Vote:
 

And redirect still does not work. Strange.  Do you have any errors in the log?

Do you have any other middleware or some request handler that might catch 404 errors?

#297343
Feb 27, 2023 19:10
Vote:
 

Maris Krivtezs: Follows is the code:

and within the app.config, I have:

Please advise

Dont see any errors in the log..

#297392
Feb 28, 2023 0:59
Vote:
 

I think `app.config` or `web.config` is not needed anymore in Optimizely 12.

See Optimizely's example project: https://github.com/episerver/Foundation/tree/main/src/Foundation

Maybe try comparing. Also, check for any initialization modules that might catch 404 errors and rewrite content (from the screenshot it even does not redirect).

#297410
Feb 28, 2023 12:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.