I think this is a well known problem in TYPO3 – i found several forum posts – but no solution.
If you have a website with some “member only” pages, probably a forum (i use mm_forum in this installation) and users get a email with a notification for new topics or something like this …
Inside the email you get a direct link to your “member-only” page.
In combination with realurl the link will cause “404 – Page not found” situation. Test it – it is horrible.
You must consider, if you restrict the hole page, you will never solve this problem.
You must only restrict the pagecontent for fe_users. I write it again: never restrict the hole page!
So, i searched for a solution. Found this one, very nice and it works! Thank you Sanderrr!
[usergroup=*] [else] config > config.additionalHeaders = Location: /index.php?id=PID_DES_LOGINFORMULARS page > page = PAGE page.10 = TEXT page.10.value=No Access! [global]
But what’s up with a redirect to your first link location after login? config.additionalHeaders dislike COA_INT or TEXT.
A new problem – so we need a new solution … page redirect with condition in TYPOP3. Help me!
After one night without sleep, bad dreams and beer i build my own typoscript legendary redirect setup. Praise me
#page 123 is restricted [PIDinRootline = 123] page.headerData.666 = COA_INT page.headerData.666.10 = TEXT page.headerData.666.10.value = <meta http-equiv="refresh" content="0; URL=/index.php?id=11&referer= #index.php?id=11 -> my loginpage page.headerData.666.20 = TEXT page.headerData.666.20.insertData = 1 page.headerData.666.20.data = getIndpEnv:TYPO3_REQUEST_URL page.headerData.666.30 = TEXT page.headerData.666.30.value = " /> [global] #remove redirect, if user logged in [usergroup = *] && [PIDinRootline = 123] page.headerData.666 > [global]
You can see, i use the page.meta.refresh function to redirect my restricted pages. Not sweet but it works like a charm.
That’s enough for today. TYPO3 inspiring to share!