As we serve a lot of files which are sometimes marketed by email, we might provide URLs to directly download files which could really be mistyped on occasions. Is there anyway to apply the redirect to any non existing URL, irrespective of if it s a pretty URL or one ending with a file extension?
I had some issues regarding this and in my case I was trying to force the custom 404 page, the workaround that I found was to set inside the web.config this:
Basically, the request will be handled by the server as 404 error it will try to open the page error "/arbitraryPathThatDoesNotExistAndThatWillRespondWithA404" so the .Net will handle as 404 error to Umbraco.
URLs with file extensions do not redirect to set 404
Hey again :)
Umbraco cloud 7.12.4
Installed the plugin and all is well however there is no redirect in place if someone enters a url which ends with a file extension such:
http://www.mysite.com/thisfile.pdf
As we serve a lot of files which are sometimes marketed by email, we might provide URLs to directly download files which could really be mistyped on occasions. Is there anyway to apply the redirect to any non existing URL, irrespective of if it s a pretty URL or one ending with a file extension?
Thanks,
Greg
think you'll need to look into the web.config and make sure the requests are handled by .net
Hi Gregory,
I had some issues regarding this and in my case I was trying to force the custom 404 page, the workaround that I found was to set inside the web.config this:
Basically, the request will be handled by the server as 404 error it will try to open the page error "/arbitraryPathThatDoesNotExistAndThatWillRespondWithA404" so the .Net will handle as 404 error to Umbraco.
Top stuff man! that sorted it! Thanks a lot for that! :)
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.