My client is updating their old Umbraco 3 site to Umbraco 4.71. On their old site, all pages had .aspx as the extension. On the new site they want to use friendly directory URLs with the trailing slash. I have this all set up and it works fine. My question is regarding the .aspx extension when uysing directory URLs...
Umbraco seems to still allow the .aspx extension on the new site, even though directory URLs is turned on. This means that if I type in my browser www.domain.com/contact.aspx on the NEW site, the page still loads, and retains the .aspx extension. I need umbraco to not allow the .aspx extension and throw a 404 status.
I already have programming developed where I can specify all the old .aspx URLs, and when detected, will forward the request to the new friendly URLs using a 301 status. But this programming doesn't kick in unless a 404 status is triggered.
Bottom line... I need Umbraco to trigger a 404 status on all URLs that contain the .aspx extension. Possible?
From what I'm reading you want a 301 redirect. This can be done using a simple urlrewite configuration. Check out this blogpost that does this and and a lot more for SEO imporovement
Hi. If you want to do this just for SEO purposes then perhaps a more modern way to resolve the duplicate content issue would be using meta canonical tag in the page header. You can use an existing component for it (search the project section of this site).
If on the other hand you really want to give 404 for any .aspx-ended request you could set up a URL rewriting rule for it in IIS URL rewriting module or UrlRewritingNet - whichever you prefer.
Umbraco directory URLs without the .aspx
Hello,
My client is updating their old Umbraco 3 site to Umbraco 4.71. On their old site, all pages had .aspx as the extension. On the new site they want to use friendly directory URLs with the trailing slash. I have this all set up and it works fine. My question is regarding the .aspx extension when uysing directory URLs...
URL of the OLD site contact page: www.domain.com/contact.aspx
URL of the NEW site contact page: www.domain.com/contact/
Umbraco seems to still allow the .aspx extension on the new site, even though directory URLs is turned on. This means that if I type in my browser www.domain.com/contact.aspx on the NEW site, the page still loads, and retains the .aspx extension. I need umbraco to not allow the .aspx extension and throw a 404 status.
I already have programming developed where I can specify all the old .aspx URLs, and when detected, will forward the request to the new friendly URLs using a 301 status. But this programming doesn't kick in unless a 404 status is triggered.
Bottom line... I need Umbraco to trigger a 404 status on all URLs that contain the .aspx extension. Possible?
Hi Robert,
From what I'm reading you want a 301 redirect. This can be done using a simple urlrewite configuration. Check out this blogpost that does this and and a lot more for SEO imporovement
Hope this helps you,
Richard
Hi. If you want to do this just for SEO purposes then perhaps a more modern way to resolve the duplicate content issue would be using meta canonical tag in the page header. You can use an existing component for it (search the project section of this site).
If on the other hand you really want to give 404 for any .aspx-ended request you could set up a URL rewriting rule for it in IIS URL rewriting module or UrlRewritingNet - whichever you prefer.
is working on a reply...