Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi Kristoffer
The default url to CMS 12 backend login is either /util/login or /episerver/cms. There are two endpoints are registered by default to match these two urls.
You might notice /episerver is working in foundation demo site, because it has Episerver find package installed and the /episerver route is somehow registered in the Episerver.Find package in CMS 12.
I hope above helps.
Now that was embarrassing! Before /episerver always redirected you to the login page but not anymore.
/episerver/cms works just perfect!
Thanks!
/Kristoffer
If you've formed a habit of just typing "/episerver" into the URL and expecting to get to the login or edit UI (like I have), you could just add a rewrite in your Startup.cs.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
var rewriteOptions = new RewriteOptions()
.AddRedirect("episerver(/)?$", "episerver/cms");
app.UseRewriter(rewriteOptions);
...
}
I'm not sure what implications this will have, but it works for the time being.
Hi!
So the upgrade from CMS 11 to CMS 12 is now working, finallly. But I cannnot access /episerver, that jus gives me as 404.
Any idea what I'm missing? It looks like every under /modules is there.
public class Program { public static void Main(string[] args) { var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); var isDevelopment = environment == Environments.Development; if (isDevelopment) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Warning() .WriteTo.File("app_data/log.txt", rollingInterval: RollingInterval.Day) .CreateLogger(); } CreateHostBuilder(args, isDevelopment).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args, bool isDevelopment) { if (isDevelopment) { return Host.CreateDefaultBuilder(args) .ConfigureAppConfiguration(config => { config.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("COMPUTERNAME")}.json", optional: true, reloadOnChange: true); }) .ConfigureCmsDefaults() .UseSerilog() .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } return Host.CreateDefaultBuilder(args) .ConfigureCmsDefaults() .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } }
public class Startup { private readonly IWebHostEnvironment _webHostingEnvironment; private readonly IConfiguration _configuration; public Startup(IWebHostEnvironment webHostingEnvironment, IConfiguration configuration) { _webHostingEnvironment = webHostingEnvironment; _configuration = configuration; } public void ConfigureServices(IServiceCollection services) { if (_webHostingEnvironment.IsDevelopment()) { services.Configure<SchedulerOptions>(o => { o.Enabled = false; }); services.PostConfigure<DataAccessOptions>(o => { o.SetConnectionString(_configuration.GetConnectionString("EPiServerDB").Replace("App_Data", Path.GetFullPath("App_Data"))); }); services.PostConfigure<ApplicationOptions>(o => { o.ConnectionStringOptions.ConnectionString = _configuration.GetConnectionString("EPiServerDB").Replace("App_Data", Path.GetFullPath("App_Data")); }); } services.AddCmsAspNetIdentity<ApplicationUser>(); services.AddMvc(); services.AddAlloy(); services.AddCms(); services.AddEmbeddedLocalization<Startup>(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseMiddleware<AdministratorRegistrationPageMiddleware>(); } app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapContent(); endpoints.MapControllerRoute("Register", "/Register", new { controller = "Register", action = "Index" }); endpoints.MapRazorPages(); }); } }
Thanks!