How do you guys normally force the homepage of the site to be / in your macros etc?
I used to just have a UrlName set to '/' but I've noticed problems with this when you force trailing slashes on the end of your URLs. Basically, everything one level deep is rendered as the homepage, for example '/cheese/' shows the homepage, even when no such page exists. If I take off the UrlName, it works as expected (ie the correct one level pages, and 404s for non-existant URLs).
This isn't a problem if you are using extensionless urls without the trailing slash, but for this project I have to, to avoid nuking a sites SEO rankings with unnessesary 301s. As a quick fix, I've just added an if statement around my sitemaps etc to show a '/' for the root node, overrdinig what's there (currently '/home').
Are there any better ways of getting the root node to show up as '/'?
I've done a fair bit of research into getting Umbraco to work with and without trailing slashes for SEO (I'm currently working at an SEO agency), I think I'll add something to the docs about it over the next few weeks, with all the rewrite rules that I'm using etc.
Issue With Homepage
Hi,
How do you guys normally force the homepage of the site to be / in your macros etc?
I used to just have a UrlName set to '/' but I've noticed problems with this when you force trailing slashes on the end of your URLs. Basically, everything one level deep is rendered as the homepage, for example '/cheese/' shows the homepage, even when no such page exists. If I take off the UrlName, it works as expected (ie the correct one level pages, and 404s for non-existant URLs).
This isn't a problem if you are using extensionless urls without the trailing slash, but for this project I have to, to avoid nuking a sites SEO rankings with unnessesary 301s. As a quick fix, I've just added an if statement around my sitemaps etc to show a '/' for the root node, overrdinig what's there (currently '/home').
Are there any better ways of getting the root node to show up as '/'?
I've done a fair bit of research into getting Umbraco to work with and without trailing slashes for SEO (I'm currently working at an SEO agency), I think I'll add something to the docs about it over the next few weeks, with all the rewrite rules that I'm using etc.
:)
Hi Tim,
If you set a hostname on your root/homepage node, then the NiceUrl will use that domain name instead of it's urlName.
Try it out, let us know if it works out.
Cheers, Lee.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.