Adding redirects in the back office (v10)
# help-with-umbraco
s
I've been looking at adding a url rewrite manager into the back office and wondered if anyone has any recommendations for a package?
m
though if these are rewrites that shouldn't be/don't need to be in middleware/backoffice handling with IIS urlrewrite should be the preference.. according to MS https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-7.0#when-to-use-url-rewriting-middleware
s
Thanks @Mike Chambers - We already have IIS rewrites running via middleware, as well as a last chance content finder. However, customer is wanting more control over the rewrites (...I've warned them...). Have you had any experience of the "Skybrud Redirects" or "Redirect Manager for Umbraco packages"?
m
you can have iis rewrites running without middleware (improves perf).. using the
web.config
and
web.{env}.config
transforms of old.. if you add in
-p:EnvironmentName={env}
to the dotnet publish command
if you already have a last chance content finder, can you not just add a textbox prop for a csv of urls that should rewrite to this node for your content nodes and use your content finder to interogate that?
I guess the advantage of a dashboard is it centralises, and you could have regexp. I've not used either package but have heard good things re skybrud redirects. We've never used as too easy for clients wth the power to generate circular redirects 😦
urltracker is another one to look at I think came out of the old 301urltracker (which I have used in the past) and is a complete replacement for the core urlredirection, in v8 it used to disable the core redirrect too. though now you might have to use the appsetting to disable the core one.. as again you can end up with circular references.. It also can log your 404's too so you can generate redirects as you notice them.. but if not actively managed can quickly get out of hand re DB size...
j
We use Skybrud.Redirects, it gives a dashboard where you can just paste in an incomming url and then pick the node you want to redirect that to. Works super well 🙂
s
@Mike Chambers - yeah...really don't want to give this to the client, but they're stamping their feet...countdown to circular references in 3, 2, 1...! Thanks for the info re:urltracker too 🙂
Think I'll probably try the Skubrud redirects first
Ended up installing the Skybrud package, but it wouldn't redirect out of the box (the site already relies heavily on url rewrites to manage some internal wrangling). However, I managed to DI the package's IRedirectService and get what I needed. Thanks @Mike Chambers and @Jemayn for the suggestions!
d
Just want to add to this, as current maintainer of the URL Tracker, I've optimised the database storage of the URL Tracker quite a bit, so although it can still get out of hand, it can store waaaay more 404s before it actually starts to affect your memory. Previously it would store the url string for each 404, but now it's just a pointer, so each 404 is just 3 numbers in the database. That being said, a cleanup cycle wouldn't be a bad idea for the package
2 Views