[TYPO3] 404 redirect and .htaccess
Oliver Rowlands
oliver at liquidlight.co.uk
Sat Sep 13 16:05:27 CEST 2008
Hi Janus,
401 and 404 errors have nothing to do with each other.
A 401 will be fired by Apache if an authenticated/unauthenticated user
tries to access a URI he does not have access to. TYPO3 does not even
get triggered in that event as everything happens at the Apache level.
Have a look at Apache's custom error documents settings, add the
following to your .htaccess:
ErrorDocument 401 /401_error_page.html
You will need to set the <base> element in your HTML <head> in order for
your page assets (ie: CSS, images, JS, etc.) to work correctly.
Best regards,
Oliver
janus76 wrote:
> I was wondering if anyone can help with this:--
> here is my setup
> Typo3 4.2.1
>
> I have a site setup in a sub-directory on the web root call my_site:-
> /-
> |
> my_site
> |
> Other Sites
>
> I have setup a page not found page with id=10
>
> configuring localconf.php with
> $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] =
> '/my_site/index.php?id=10';
> $TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] = 'HTTP/1.0 404
> Not Found';
>
> this works fine.
> However i wish to protect my_site with a simple .htaccess file i.e
>
> AuthName "My Site protected"
> AuthType Basic
> AuthUserFile /somewhere on the server/.htpasswd
> Require user me
>
> By doing this I now get a 401 authorization required page.
>
> is there anyway around this?
> I am missing something in the configuration to set the pageNotFound_handling
> variable to a relative url?
>
> any help on this would be appreciated
>
>
> Thanks
>
> Janus
--
Oliver Rowlands
:: Liquid Light ::
E - oliver at liquidlight.co.uk
W - http://www.liquidlight.co.uk
T - 00 44 (0)845 6 58 88 35
F - 00 44 (0)845 6 58 44 35
More information about the TYPO3-english
mailing list