Infocaster / UrlTracker

An Umbraco package that tracks 404 not found results and helps you redirect visitors to the right page
https://infocaster.net/wat-we-doen/umbraco-plugins/301-url-tracker
MIT License
17 stars 12 forks source link

Multisites and missing root node option when adding a new redirect #166

Closed james-whittington1 closed 7 months ago

james-whittington1 commented 7 months ago

How does this package work when some of the top level nodes (but not all of them) have domains assigned?

We normally don't bind the default domain for the site to the root node, and only additional domains in a multisite project would be added to the appropriate nodes.

We're using Umbraco cloud, and the first node in our tree has no domain assigned. in the portal we have bound the "example.com" domain name to the project, and now when we go to example.com, the site shows as expected.

We then bound another domain "example-two.com" in the portal, and and attached it to a new "homepage" node.

We can now view the original homepage node on example.com, and the new homepage on example-two.com.

When trying to create a new redirect however, only homepage-two is visible.

Is there a way to have the root nodes show up even if they don' t have a domain name attached?

D-Inventor commented 7 months ago

Hi @james-whittington1 ! Thank you for reaching out and an excellent question.

Right now, the URL Tracker relies on domains to match incoming requests with content nodes. It is therefore required to configure a domain on all root nodes that you want to use in the URL Tracker.

However, with some configuration, you might still be able to get the desired result. The URL Tracker also recognizes wildcard domains. A wildcard domain is when you explicitly select a culture under the "cultures and hostnames" menu, but don't add a domain name. You can see in the following screenshot how I configured a Dutch wildcard domain: Screenshot of a configured wildcard domain

It is then recommended to set these configurations: HasDomainOnChildNode: false IncludeWildcardDomains: true

You can read more about configurations in the readme.

Do keep in mind that you might have some trouble if you want to redirect across domains to content nodes with this setup. If you don't explicitly define a domain on your first root node, the URL Tracker won't know which domain to redirect to, should you redirect from your second domain.

Is this answer satisfactory?

james-whittington1 commented 7 months ago

Perfect - thank you. Added and working fine now :)

I did not know that a culture could be added independently like that either.