Episerver 8.3.0 - override cms logout url

Vote:
 

Hi,

I'm trying to override the default logout url.

I've added a new route to the route collection:

routes.MapRoute("Logout", "util/logout.aspx", new { action = "Logout", controller = "Account" });

Any clues why it is not working?

Thanks,

Luca

#123605
Jul 09, 2015 17:56
Vote:
 

Try in EPiServerFramework configuration section to use the virtualPathMappings element to override it instead. Make sure the VirtualPathMappedProvider is in the list as well.

<virtualPathMappings>
    <add url="util/logout.aspx" mappedUrl="/Accont/Logout" />
</virtualPathMappings>

Hope this helps

Frederik

#123607
Jul 09, 2015 22:15
Vote:
 

Frederik thanks for your answer.

I've added this provider under virtualPathProviders

<add name="CustomUrlMapping" type="EPiServer.Web.Hosting.VirtualPathMappedProvider, EPiServer" />

then

<virtualPathMappings>
<add url="~/util/logout.aspx" mappedUrl="~/logout.aspx" />
</virtualPathMappings>

It seems to work only if the file extension is the same though.

Is there anything else I can override to use an MVC route?

Thanks.

#123613
Jul 10, 2015 10:52
Vote:
 

For anyone else looking this would work:

public class Startup 
{
	public void Configuration(IAppBuilder app)
	{
		app.Map("/util/logout.aspx", map =>
		{
			map.Run(ctx =>
			{
				ctx.Response.Redirect("/to/custom/route");
				return Task.FromResult(0);
			});
		});
	}
}



#141287
Nov 11, 2015 11:36
* 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.