Connecting Tech Pros Worldwide Forums | Help | Site Map

Error Pages with .htaccess

Adam King
Guest
 
Posts: n/a
#1: Jul 17 '05
Hey,

I've done the standard old trick of adding the error page line into
..htaccess which works absolutely fine if I accidently go to any file
other than .php But if I go to "doesntexist.php" I get a different
error message seemingly already installed somewhere on the server.
Does anyone know how to override this? There must be a setting somewhere!

Cheers in advance,

(I know this isn't really the right NG but i hoped someone would know! :)

Adam



Janwillem Borleffs
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Error Pages with .htaccess


Adam King wrote:[color=blue]
> I've done the standard old trick of adding the error page line into
> .htaccess which works absolutely fine if I accidently go to any file
> other than .php But if I go to "doesntexist.php" I get a different
> error message seemingly already installed somewhere on the server.
> Does anyone know how to override this? There must be a setting
> somewhere![/color]

Are you getting a standard 404 error page? Then your host doesn't allow
htaccess override.

Test this by making a deliberate error in the .htaccess file, which should
trigger a 500 internal server error when the file is actually interpreted.


JW



micha
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Error Pages with .htaccess



Janwillem Borleffs wrote:[color=blue]
> Adam King wrote:[color=green]
> > I've done the standard old trick of adding the error page line into
> > .htaccess which works absolutely fine if I accidently go to any[/color][/color]
file[color=blue][color=green]
> > other than .php But if I go to "doesntexist.php" I get a different
> > error message seemingly already installed somewhere on the server.
> > Does anyone know how to override this? There must be a setting
> > somewhere![/color]
>
> Are you getting a standard 404 error page? Then your host doesn't[/color]
allow[color=blue]
> htaccess override.
>
> Test this by making a deliberate error in the .htaccess file, which[/color]
should[color=blue]
> trigger a 500 internal server error when the file is actually[/color]
interpreted.[color=blue]
>
>
> JW[/color]

had the same problem. that works for me in .htaccess:

#php files
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) abs_uri_of_your_error_doc
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) uri_of_error_doc
RemoveType x-mapp-php4 .html

#html files
ErrorDocument 404 uri_of_error_doc

micha

Adam King
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Error Pages with .htaccess


Thanks for your advice, I haven't had chance to check it out yet, but
the help is much appreciated!!

Adam
Closed Thread