Link to home
Start Free TrialLog in
Avatar of rwniceing
rwniceing

asked on

where is my 404 error page forwards link and where is forbidden 404 page in centos apache

Dear Experts,

I have two questions  for my apache Centos6 VPS server with root access, please advise
Question-1
I try to setup my own error.html for 404. But when include or NOT-include  "ErrorDocument 404 /error.html" in my .htaccess file, whatever both methods will  also go to error.html page when try to go to my testing site at http://mysite.com/store/no-this-file.html  on browser(which is not existing on the store directory that just for  testing). So somehow, I let it worked before or long time ago.
I can NOT remember where or when  I made the error.html page forward work, Besides error page forwards is enabled(ErrorDocument 404 /error.html) in .htacess file, where else apache server can make it  possible.I check /usr/local/apache/htdocs/, there is no any .htaccess

When I  go to check the httpd.conf file at /etc/httpd/conf/, there is NO any about error document handle stuff

.htaccess file
==============================
ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

Question-2
If I try to go to directory such as http://mysite/store on browser , it will show out
404 forbidden page, I want to know where is the forbidden page is located on my
apache Centos VPS server, I try to find it at /usr/local/apache, nothing find.
Where is the fobidden page located  ? because I want to do some css on it.

Fobidden page:
--------------------------
Forbidden

You don't have permission to access /store on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_bwlimited/1.4 PHP/5.3.21 Server at 212.1.209.242 Port 80
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwniceing
rwniceing

ASKER

I know when I change .htaccess file  at my public_html directory, I don't need to
restart httpd to make  the new update on .htaccess is  effective right way.
When delete "ErrorDocument 404 /error.html" in my .htaccess file,it also work, why ? Whatever I detele or add the "Error...." or restart httpd or not, it also work , Why ? So I guess somewhere apache did it  for me that I might did it a long time ago if .htacess did NOT do it.

Do you understand my question-1 ?

Please advise
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried to detele it or NOT-inciude it  such as

#ErrorDocument 404 /error.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

it still works to get the error.html on my browser, why  ?
Now doing another test,  I copy error.html to error2.html
and enable it for error2.html as following new .htaccess file

.htaccess file
======================
ErrorDocument 404 /error2.html
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

the code ErrorDucument is also working for error2.html that is normal case and supppsed to be working. When I delete  or not-include it, it will go to error.html again.
All I can think of is that you have another copy of "ErrorDocument 404 /error.html" some where in the path or a 'conf' file.
Include "/usr/local/apache/conf/includes/errordocument.conf" that is
shown in httpd.conf. But nothing I can find about error.html

404.shtml is going to locate other page that is not error.html
errordocument.conf file
===================================
# 401 - Unauthorized
ErrorDocument 401 /401.shtml

# 402 - Payment Required
ErrorDocument 402 /402.shtml

# 403 - Forbidden
ErrorDocument 403 /403.shtml

# 404 - Not Found
ErrorDocument 404 /404.shtml


Now I think I need to find a string in a file for all directory to seach error.html string by the
following linux command with root access

grep -R "error.html" *
nothing find from grep -R "error.html"  besides those are not related

Is there any method to solve this  such as checking apache reaction to call error.html page  in
event log files so that I can see where apache module or php script to call error.html ?
I don't what else to tell you.  You can click on "Request Attention" above to get others to look at your question.
Thanks for all of your, this thread is partially solved.
it will continue on next new thread with re-write question-1 and add more detail.