Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
I'm hoping someone can help me. I've seen a lot of posts about redirecting all pages to friendly URLs by removing the .aspx extension.
I'm looking to do this the other way around. So all directory & page URLs redirect to .aspx.
For example this page has two links being indexed on google
I'm looking to redirect /about-us to /about-us.aspx
so both pages are not being indexed on Google only the .aspx page is being indexed.
Can someone help me get this sorted?
Thanks Barry
Set up an IIS rewrite rule with a regex match to any url that doesn't have a file extension and redirect
Try adding this to your web.config:
<rewrite> <rules> <rule name="Add ASPX" stopProcessing="true"> <match url="(.*[^/])$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="{R:1}.aspx" /> </rule> </rules> </rewrite>
Thanks for this Mark. Adding this returned an 500 error with a load of .aspx extensions applied to the URL. See here, any ideas?
Try this one:
<rewrite> <rules> <rule name="Add ASPX" stopProcessing="true"> <match url="(.*[^/])$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_URI}" pattern="(.*[^/]).aspx$" negate="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="{R:1}.aspx" /> </rule> </rules> </rewrite>
Thanks for this Alex, this worked for me
You are welcome, Barry!!!
Have a great evening
While the above solution worked. It made the Umbraco Control Panel break.
No JS or CSS files could be loads (Too many redirects). See the attached image.
This is how the front end looks
Any ideas on how to get around this?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
301 redirects, so all pages have .aspx
Hi there,
I'm hoping someone can help me. I've seen a lot of posts about redirecting all pages to friendly URLs by removing the .aspx extension.
I'm looking to do this the other way around. So all directory & page URLs redirect to .aspx.
For example this page has two links being indexed on google
I'm looking to redirect /about-us to /about-us.aspx
so both pages are not being indexed on Google only the .aspx page is being indexed.
Can someone help me get this sorted?
Thanks Barry
Set up an IIS rewrite rule with a regex match to any url that doesn't have a file extension and redirect
Try adding this to your web.config:
Thanks for this Mark. Adding this returned an 500 error with a load of .aspx extensions applied to the URL. See here, any ideas?
Try this one:
Thanks for this Alex, this worked for me
You are welcome, Barry!!!
Have a great evening
While the above solution worked. It made the Umbraco Control Panel break.
No JS or CSS files could be loads (Too many redirects). See the attached image.
This is how the front end looks
Any ideas on how to get around this?
is working on a reply...