Hi,
I know that htaccess modrewrite is based on document root. Here is my path to my custom error files
example.com/subdir has its own htaccess and its own 403.shtml file (i have the 404 taken care of with some fancy modrewrite so i dont need the 404)
But i need the 403, at first i thought i could use the htaccess <if) statment here
and just check to see if the response was 403, then redirect but the command data i need to use, the data is not available for the <If> statement
so what i need to do is find a way to use ErrorDocument to run in a sub directory for which i do not know the name (this is for a script that i am working on and i wont know the domain its being install on)
So how do i take this in htaccess
ErrorDocument 403 /403.shtml (this uses the 403 file in the directory above - not what i need)
and make the server see this
ErrorDocument 403 [current file directory] 403.shtml
htaccess does have a <If> statement so i dont know why i cant do something like this to avoid the whole doc root issue with their requirement of /
if that could work somehow then it would use the 403.shtml file in the same dir as the htaccess But it just gives a server error 500, wont work... 
Thanks
I know that htaccess modrewrite is based on document root. Here is my path to my custom error files
example.com/subdir has its own htaccess and its own 403.shtml file (i have the 404 taken care of with some fancy modrewrite so i dont need the 404)
But i need the 403, at first i thought i could use the htaccess <if) statment here
and just check to see if the response was 403, then redirect but the command data i need to use, the data is not available for the <If> statement
so what i need to do is find a way to use ErrorDocument to run in a sub directory for which i do not know the name (this is for a script that i am working on and i wont know the domain its being install on)
So how do i take this in htaccess
ErrorDocument 403 /403.shtml (this uses the 403 file in the directory above - not what i need)
and make the server see this
ErrorDocument 403 [current file directory] 403.shtml
htaccess does have a <If> statement so i dont know why i cant do something like this to avoid the whole doc root issue with their requirement of /
Code:
<If ErrorDocument 403>
Redirect .* 403.shtml
</If>
Thanks
Last edited: