I'm in the process of porting a static site into Kentico and want to set up redirects from the old /page.html URLS to the new clean friendly URL '/page'.
In settings > URLs and SEO I've set the following:
Friendly URL extensions: '' (blank) Redirect page aliases to main URL: checked Redirect pages to main extension: unchecked
I've then set up a Alias with the following properties: URL Path: '/page' URL Extension: '.html'
However when visting http://mysite/page.html I get a 404.
What am I missing? Any help much appreciated.
For global solution you can follow this link. Within Kentico you need to enable extensions for .html under Settings -> URL & SEO -> Friendly URL Extensions if not already to add them as Alias. Check this link to do this within Kentico.
Assuming you have the proper web.config (<modules runAllManagedModulesForAllRequests="true">) it sounds like you're only missing adding the ".html" extension here:
<modules runAllManagedModulesForAllRequests="true">
Settings>URL & SEO>Friendly URL Extensions
Brenden - adding '.html' to Settings>URL & SEO>Friendly URL Extensions does the opposite - it forces the friendly URL to redirect from:
http://mysite/page
to
http://mysite/page.html
Sorry about that, you need to include a blank at the beginning as well so your value should be
;.html;
The blank at the beginning will cover the extensionless URL setup.
I sussed that and added this:
Friendly URL Extensions ";.html;.aspx"
This now works as expected with a .aspx extension added but not with .html
If you want extensionless URLs you need to make sure you have
under the
<system.webServer>
node.
I'd already added this and extensionless URLs are already working for .aspx
http://mysite.com/page.aspx
redirects as expected to:
http://mysite.com/page
But I get a 404 on the following:
http://mysite.com/page.html
In your alias on the page, do not include the period. Your extension should read html not .html
html
.html
It looks like the runAllManagedModulesForAllRequests attribute was not added into the correct place. It has to be added here.
Please, sign in to be able to submit a new answer.