How to configure Umbraco by default on a subpage?

I have a question about structuring umbraco and I cannot find the answer anywhere.

Usually in Umbraco it will be, by default, the root site of the first node of the tree. therefore if we have

  • home
    • page 1
    • page 2

the default page will be home (so www.mysite.com will point to the home).

How can I change this so that www.mysite.com points to page 1 or page2? What if I have this structure?

  • wrapper
    • Index
    • page 1
    • page 2

and I want www.mysite.com to go directly to www.mysite.com/index.aspx

I could not find a rule that does this. I tried to insert a rewrite / redirect rule and did not change anything.

Please, help

Nick

+6
source share
2 answers

Redirecting to Umbraco is usually a very simple matter, unless you are trying to redirect from the root of your site.

Method 1:

Here he best explains: http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracoredirect

Thus, it is possible by adding the umbracoInternalRedirectId property to your root node, with the Content Picker data type. Please note that it does not redirect the user, but loads the contents of this page inside the current URL. That way, the URL will remain http://www.mysite.com while it serves the content of the page you want to redirect to.

Method 2:

If you really want it to change from http://www.mysite.com/ to http://www.mysite.com/index.aspx . I usually add something like the following code to the node root pattern.

 <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"> </asp:Content> <script type="c#" runat="server"> protected void Page_Load(object sender, EventArgs e) { Response.Redirect("http://www.mysite.com/index.aspx"); } </script> 

So ASP.Net is responsible for the redirect. But it obviously will not handle node renaming / moving too well.

+4
source

you can redirect to any page using Url Rewriting Config / UrlRewriting.config

adding this role

 <add name="role1" virtualUrl="^~/$" destinationUrl="~/home" redirect="Application" redirectMode="Permanent" ignoreCase="true" /> 
0
source

Source: https://habr.com/ru/post/907584/


All Articles