we've a new v8 site going live tomorrow and i'm keen to get a trailing slash rewrite rule set up.
i remember in v7 this was a little bit of a risky one as it can really mess up the backoffice...
has anyone got an ultimate redirect for v8 that's rock solid for the trailing forward slash that they could post here so it can forever be the gospel according to seo?!?!
<requestHandler>
<!-- this will add a trailing slash (/) to urls when in directory url mode -->
<addTrailingSlash>true</addTrailingSlash>
</requestHandler>
As mentioned in the comment above, this will add a trailing slash to the url when
regardless of if i set it to true or false i can still access the page using the url with and without the trailing forward slash meaning both these urls work:
change is not only in backooffice, it's change url provider to generate url with or without / at the end.
if you want redirect urls with "/" to url without yoou can add this redirrect rule, very important to do it together, owerwise site will generate links links with redirects
trailing slash rewrite rule for v8
hey out there,
we've a new v8 site going live tomorrow and i'm keen to get a trailing slash rewrite rule set up.
i remember in v7 this was a little bit of a risky one as it can really mess up the backoffice...
has anyone got an ultimate redirect for v8 that's rock solid for the trailing forward slash that they could post here so it can forever be the gospel according to seo?!?!
cheers,
jake
not sure what you need it, in umbracoSettings.config
in section
<requestHandler>
add
hey yakov,
thanks for the reply ;)
i've just checked the docs for that setting as i've never quite understood it:
https://our.umbraco.com/documentation/reference/config/umbracosettings/#addtrailingslash
regardless of if i set it to true or false i can still access the page using the url with and without the trailing forward slash meaning both these urls work:
https://localhost:44377/search
https://localhost:44377/search/
the only difference is that in the backoffice, if the setting is set to false the url changes in the info tab:
so although the setting changes the url in the backoffice, it doesn't enforce it with a redirect on the front end...
confusing eh?!
cheers,
jake
Hi Jake
You can use this rewrite rule:
change is not only in backooffice, it's change url provider to generate url with or without / at the end.
if you want redirect urls with "/" to url without yoou can add this redirrect rule, very important to do it together, owerwise site will generate links links with redirects
This code ruins Umbraco Preview in backoffice (Version 12).
Here's a corrected version:
is working on a reply...