I have a TYPO3 10.4 with Frontend Login enabled. Subpages are behind a FE Login:
If i want to link to an subpage domain.com/page1/page1-1/page1-1-1/ I get an 404 Error:
Page Not Found
The page did not exist or was inaccessible. Reason: Subsection was found and not accessible
In my TypoScript I have:
config {
typolinkLinkAccessRestrictedPages = 2450
typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID###
}
According to the documentation about typolinkLinkAccessRestrictedPages
How can I setup my page to redirect to the login form with the right URL.

This configuration is only used when you generate links. This does not handle cases which directly access the URL. https://github.com/plan2net/sierrha can help you with that.