Apache:.htaccess ErrorDocument上升一级?

my site structure like this:

- pages
    404.php
    403.php
- app
    /css
    /-script
    index.php
    .htaccess

in my .htaccess

if I type ErrorDocument 403 /403.php

and put 403.php inside /app and it works

but I need to do something like ErrorDocument 403 ../pages/403.php

how can I achieve that?

I believe that this is not possible. In order to retrieve a document above the root, you would need to create a script that fetches it's content.

The ErrorDocument instruction can only see below it's location, not above.

So, if you were to create an error.php file in the app directory that fetches the file from the pages directory (according to the parameter ?error=404), it would work.

ErrorDocument 404 /error.php?error=404

Another option would be to place the .htaccess file a folder up. .htaccess files are being read (and "used") for any folder "under" the .htaccess as long there is not one in the specific folder "overriding" the .htaccess most upward.

All this depends on your setup, though. (DocumentRoot, etc.)