Ok this is the first problem i've encounterd using .htaccess not to sure what i'm doing wrong. Here's the problem:-
I have a main domain 'www.mydomain.net' and have created a subdomain 'secure.mydomain.net' in the subdomains root i have created a .htaccess file to password protect the entire subdomain this works perefectly
I am now trying to set up custom error pages for the subdomain, i have already added them to my main domain and they work fine, but i cant get them to work on my subdomain
i have added the following to .htaccess
(the path and filenames are all correct)
ErrorDocument 401 /errors/401.shtml
If for example i go to login to my protected subdomain and deliberately enter the wrong crudentials i should be taken to my custom error page '401.shtml'
instead i get the standard Apache 401 page. It seems that because i failed athentication (deliberately to test the 401 page) i therefore do not have the rights to view the custom '401.shtml' page on my server
So i thought i would try to redirect the error pages from my protected subdomain to my error pages on my unprotected main domain. example:-
ErrorDocument 401 /../errors/401.shtml
hoping that /../ would take me back up a level into my main domains root folder, but it appears that the subdomain folder is treated as root for the subdomain and therefore ../ is not valid as there is no subdirectory to root! Aaaaagh!!!
So i then tried to use Apache's 'redirect' command in the .htaccess to redirect the 'errors' folder to the unprotected 'errors' folder on my main domain example:-
Redirect errors/ http://www.mydomain.net/errors/
ErrorDocument 401 errors/401.shtml
this didn't work either giving me the same problem, i have also tried the following :-
ErrorDocument 401 http://www.mydomain.net/errors/401.shtml
but in my server log i get told :- [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring
If i cant use a full URL to my error page and i can't use internal '../' then what can i use?
Now i'm stuck
I want to keep my subdomain password protected from root. but i also want my subdomains custom error pages to work. I'm not an expert in this field and i'm sure it must be possible to do this. I've searched various forums for an answer and found a few dirfferent people with the same problem.
Anyone's help would be greatly appriciated.
TIA TurboSquid
I have a main domain 'www.mydomain.net' and have created a subdomain 'secure.mydomain.net' in the subdomains root i have created a .htaccess file to password protect the entire subdomain this works perefectly
I am now trying to set up custom error pages for the subdomain, i have already added them to my main domain and they work fine, but i cant get them to work on my subdomain
(the path and filenames are all correct)
ErrorDocument 401 /errors/401.shtml
If for example i go to login to my protected subdomain and deliberately enter the wrong crudentials i should be taken to my custom error page '401.shtml'
instead i get the standard Apache 401 page. It seems that because i failed athentication (deliberately to test the 401 page) i therefore do not have the rights to view the custom '401.shtml' page on my server
So i thought i would try to redirect the error pages from my protected subdomain to my error pages on my unprotected main domain. example:-
ErrorDocument 401 /../errors/401.shtml
hoping that /../ would take me back up a level into my main domains root folder, but it appears that the subdomain folder is treated as root for the subdomain and therefore ../ is not valid as there is no subdirectory to root! Aaaaagh!!!
So i then tried to use Apache's 'redirect' command in the .htaccess to redirect the 'errors' folder to the unprotected 'errors' folder on my main domain example:-
Redirect errors/ http://www.mydomain.net/errors/
ErrorDocument 401 errors/401.shtml
this didn't work either giving me the same problem, i have also tried the following :-
ErrorDocument 401 http://www.mydomain.net/errors/401.shtml
but in my server log i get told :- [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring
If i cant use a full URL to my error page and i can't use internal '../' then what can i use?
Now i'm stuck
I want to keep my subdomain password protected from root. but i also want my subdomains custom error pages to work. I'm not an expert in this field and i'm sure it must be possible to do this. I've searched various forums for an answer and found a few dirfferent people with the same problem.
Anyone's help would be greatly appriciated.
TIA TurboSquid
