[TYPO3-english] Redirect to login instead of 404 error page if fe_user has no correct permission

Jan Bartels j.bartels at arcor.de
Thu Dec 13 19:57:35 CET 2012


Am 13.12.2012 15:25, schrieb Pablo Feldman:
> When I trying to load a page for some special fe_group, if the user is not
> logged in, Typo3 return a 404 error page, I think it would be better to
> send user to login page.
>
> To fix this, I found I can add something like this on my localconf:
>
> $TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] =
> 'USER_FUNCTION:fileadmin/scripts/404.php:user_pagenotfound->pagenotfound';
>
> however, to do this, I have to do 2 redirects, loosing performance, I think
> there must be some way to redirect to login before error handler intercept
> it.

I think there's no official way to do it. I have written an own 
404-Handler that parses the error-message. If the string contains 
something with "access" the handler redirects to the login-page. If the 
string is not found, the handler retrieves the 404-page. This approach 
works with internal restricted links as well as with links from extern.

Maybe you should file a feature-request for the core on forge to support 
separate handlers for 404- and 401-errors in the future.

Jan



More information about the TYPO3-english mailing list