SiteFinity regex url url

I am struggling with a URL rewriting rule for SiteFinity. I try to provide access to the home page only through /, not /default.aspx.

I tried the following rule:

<rule mode="PermanentRedirect">
    <url>/default.aspx</url>
    <rewrite>/</rewrite>
</rule>

Which actually works great on the home page - however, it also catches /sitefinity/default.aspxand redirects from the home page - is not very useful for content editors!

I need a rule that will match when nothing is left before the line /default.aspx.

Can anyone help?

+3
source share
2 answers

This should work:

<url>^/default\.aspx</url>

^ flavors " ", , . , <url> , - " ( )", /defaultXaspx.

+2

, .

, " " .

strreplace "/default.aspx" with "/"

.

0

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


All Articles