Unfortunately @Steve that didn't work. I 301 redirects are working, but the Umbaco CMS is still broke and now it doesn't display any images from the Media control panel within Umbraco.
<rule name="Append aspx" stopProcessing="true">
<match url="^(.*)" ignoreCase="true"/>
<conditions logicalGrouping="MatchAll">
<!-- if mydomain.com is requested without a page -->
<add input="{URL}" pattern="(.*).aspx" negate="true"/>
<add input="{URL}" pattern="^$" negate="true"/>
<add input="{URL}" pattern="^\/$" negate="true"/>
<!-- umbraco backoffice and api bits and bats -->
<add input="{URL}" pattern="^.*/(base|webshop|umbraco|umbraco_client|client|install|api|bundles|app_plugins)/" negate="true"/>
<add input="{URL}" pattern="^.*/umbraco" negate="true"/>
<!-- files -->
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}.aspx"/>
</rule>
I've just tested it on a test install and I can access Umbraco, upload an image, display it on the front end. No errors on the homepage nor on the fav icon now.
If I strip out child-page.aspx I am left with /parent-page/ which leaves me with a trailing slash.
How would I go about changing that so /parent-page/ redirects to /parent-page.aspx
If I strip out the trailing slash on /parent-page/ it redirects fine. I would just like it to do it automatically if a user lands on a parent page with a trailing slash.
My 301 redirect rule breaks the Umbraco control panel
Hi there,
I have the following 301 redirect rule which redirects all clean URL directory's to a .aspx extension
for example
(Old URL) - domain.com/about-us (Redirect URL) - domain.com/about-us.aspx
While this works. It breaks the Umbraco control panel when I login
This is what the control panel looks like
This is the errors I'm seeing
Has anyone got any ideas on how to get around this so the Umbraco control panel doesnt break while still keeping the redirects in place?
Thanks Barry
Hi,
I think Niels' whitelist approach will help you here
https://24days.in/umbraco-cms/2014/redirect-rules/
HTH
Steve
Thanks for that, yes that did work, but the redirect rule I had in place stopped working.
I tried the following, but it's not working for me, has anyone any ideas on how to sort this
Hi,
Try
There's some specific rules not to redirect the default homepage (e.g. mydomain.com/.aspx)
HTH
Steve
Unfortunately @Steve that didn't work. I 301 redirects are working, but the Umbaco CMS is still broke and now it doesn't display any images from the Media control panel within Umbraco.
Hi,
Have you cleared your cache and done a hard reload (in Chrome with dev tools press and hold the refresh button).
Browsers cache 301 redirects so if you've changed the rules and fixed them you might not know.
Steve
Spotted some issues with files and app plugins.
Clear you cache etc and try this one.
I've just tested it on a test install and I can access Umbraco, upload an image, display it on the front end. No errors on the homepage nor on the fav icon now.
What seems to be causing the issue is the following files, .aspx is being added to these files
http://localhost/dependencyhandler.axd.aspx?s=L3VtYnJhY http://localhost/webresource.axd.aspx?d=LCyOdROYwNZqHgTdlgn http://localhost/scriptresource.axd.aspx?d=KHa0P8LBeKyX0Lhv http://localhost/scriptresource.axd.aspx?d=thqZfu9UvGgIdk1N
Im not sure how to ignore a .axd file
I found by adding this it resolved the .axd issues
So the full rewrite rule is
Thanks all for the help on this topic.
Hi there,
The above works fine except for pages inside a folder
i.e
http://localhost/folder1/page1/
If we have a trailing slash on this page it outputs the following:
http://localhost/folder1/page1/.aspx
Is there anyway to get around this? I tried the following but had no joy
Anyone have any ideas on how to get around this?
Thanks
That work?
Hi Steve,
Just realised I never replied to this post, but this is all working now and thanks for the help.
If I have a url with the following
https://domain.com/parent-page/child-page.aspx
If I strip out child-page.aspx I am left with /parent-page/ which leaves me with a trailing slash.
How would I go about changing that so /parent-page/ redirects to /parent-page.aspx
If I strip out the trailing slash on /parent-page/ it redirects fine. I would just like it to do it automatically if a user lands on a parent page with a trailing slash.
I have tried the following but to no avail
is working on a reply...