fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
455 stars 298 forks source link

Hiding /tree/{tree} in URL for single-tree site #3189

Open janobarnard opened 4 years ago

janobarnard commented 4 years ago

Hi, excuse my simple question, but is it possible to modify WebRoutes.php to hide the "/tree/{tree}" part of the URL for a single-tree site i.e. display the homepage as mysite.com instead of mysite.com/tree/{tree}? I will only ever have a single family tree on my genealogy site. Thanks in advance!

fisharebest commented 4 years ago

As well as route matching (WebRoutes.php), you would also need to update route generation. Any route-parameter that does not have a placeholder is added to the query string. So, you'd get ?tree=XXX for these URLs.

There are some routes where the tree parameter is optional which may cause difficulties, as they may use different logic when no tree is supplied and we cannot distinguish the two cases.

Many modules generate their own routes, outside WebRoutes.php, which would also need changing.

The "user-facing code" doesn't actually know if there is more than one tree. We filter private trees at a very low level, so you can only know about trees that you have permission to see.

I don't think it will be quite a simple as it sounds.

Another problem is knowing 100% that there will never be another tree. For support issues, we often ask people to create a test tree on their site (especially when the main tree is private). People often develop side-projects, such as one-name studies, or host trees for people. As soon as you add a second tree, you'll break all your bookmarks, search-engine indexes, etc.

rsbarreiro commented 4 years ago

could implement some parameter for DefaulTree, so it could have urls without the tree going to the default tree, and with the tree going to the specific tree. this could have urls without a tree even if you have more than one tree...

gregoiregentil commented 1 week ago

+1

For some reasons, I'm interested by such case as I have external redirection to my webtrees website and it includes only the personID. I have also one tree and expect to have only one tree on this website (yes, not 100% but 99.9999%).

I think that to have a default tree in option makes sense and if there is one tree, it should be the default of the default tree.