What happens if I browse to www.olddomain.com is a YSOD after I have been redirect to the new domain site:
[NullReferenceException: There is no current PublishedContentRequest, it must be initialized before the RenderRouteHandler executes]
Umbraco.Web.Mvc.RenderRouteHandler.GetHttpHandler(RequestContext requestContext) +208
System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +9966527
System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +82
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +71
UrlRewriting has slightly different context to IIS Rewrites. Try changing your virtualUrl to "^~/$" to capture everything and redirect to the new site.
Thank you for answering. I have tried your suggestion and unfortunately the result is the same. It seems that I am transferred to the new site and the error occurs there, in my browser the url changes to: https://newsite.com/umbraco/RenderMvc
Just found out that it was Chrome fooling me. An old configuration of the redirect was cached. After resetting this (F12, preserve log, navigate to olddomain.com) it all worked - with my original config.
Redirect to new domain
I'm having problem with redirecting to a new domain. What I want to achieve is redirecting (301) all http://www.olddomain.com to https://www.newdomain.com (also http://olddomain.com to https://newdomain.com). Requests for all pages on old domain should all go to startpage on new, so http://olddomain.com/somepage should redirect to https://newdomain.com. Old domain is Umbraco 7.3.4 webforms and the new is Umbraco 7.10.4 MVC.
In UrlRewriting.config on the old domain site I have configured:
What happens if I browse to www.olddomain.com is a YSOD after I have been redirect to the new domain site:
How should I configure this correctly?
UrlRewriting has slightly different context to IIS Rewrites. Try changing your virtualUrl to "^~/$" to capture everything and redirect to the new site.
Thank you for answering. I have tried your suggestion and unfortunately the result is the same. It seems that I am transferred to the new site and the error occurs there, in my browser the url changes to: https://newsite.com/umbraco/RenderMvc
Just found out that it was Chrome fooling me. An old configuration of the redirect was cached. After resetting this (F12, preserve log, navigate to olddomain.com) it all worked - with my original config.
is working on a reply...