Try our conversational search powered by Generative AI!

Handle redirection to simple URL format

Fixed in

EPiServer.CMS.Core 12.7.0

(Or a related package)


Mar 21, 2022


Jun 21, 2022


CMS Core


Closed, Acceptance tests pass


Currently, CMS pages with a simple URL have two page URLs: the full page URL and the simple URL. If simple URL format is preferred (RoutingOptions.PreferredUrlFormat = PreferredUrlFormat.Simple), then generated URLs will be in simple format. However, the full page URL is still accessible.

Ideally a request to the full page URL will result in a temporary redirect (HTTP 302 Found) to the simple URL, and this redirection behavior could be configurable.


In Startup.cs

public void ConfigureServices(IServiceCollection services)
    // omitted for brevity

    services.Configure<RoutingOptions>(o => o.PreferredUrlFormatRedirection = HttpRedirect.Permanent);

There are three possible values for HttpRedirect:

  • None
  • Temporary
  • Permanent

You also can set through appsettings.json.