Error Pages with .htaccess

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adam King

    Error Pages with .htaccess

    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.ph p" 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

    #2
    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.ph p" 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



    Comment

    • micha

      #3
      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.ph p" 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_FILEN AME} !-f
      RewriteCond %{REQUEST_FILEN AME} !-d
      RewriteRule (.*) abs_uri_of_your _error_doc
      RewriteEngine On
      RewriteCond %{REQUEST_FILEN AME} !-f
      RewriteCond %{REQUEST_FILEN AME} !-d
      RewriteRule (.*) uri_of_error_do c
      RemoveType x-mapp-php4 .html

      #html files
      ErrorDocument 404 uri_of_error_do c

      micha

      Comment

      • Adam King

        #4
        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

        Comment

        Working...