Redirect var in 404 not working after EasyApache Update

Rajeeva Lochana

Well-Known Member
Community Guide Contributor
May 27, 2019
122
39
28
India
cPanel Access Level
Root Administrator
Previously till now, I had the apache's default 404 pages running because I like those. Those pages showed the requested url by the user, I know that it is the environment variable: REDIRECT_URL. They would display:

The requested URL /<the wrong url> was not found on this server.

The redirect_url var is not set anymore, and because of this, the 404 pages display:

The requested URL was not found on this server.

Am I the only one with this issue? The requested URL is not being displayed!!

And also, the other thing I noticed after the update of easyapache was that the 404 errors were not displayed in the chrome console. Only header status codes.
They are displayed for other websites.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
  • Like
Reactions: Rajeeva Lochana

Rajeeva Lochana

Well-Known Member
Community Guide Contributor
May 27, 2019
122
39
28
India
cPanel Access Level
Root Administrator
I will just take backup of whatever that file is and replace it again after an update, or I will modify it again after an update maybe.
And by the way there is no info about the hard-coded pages on the given link on httpd.apache.org.
Am I being rude here? :oops:
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
I will just take backup of whatever that file is and replace it again after an update, or I will modify it again after an update maybe.

You can indeed do that.

And by the way there is no info about the hard-coded pages on the given link on httpd.apache.org.
I'm not sure I understand what you mean. There is indeed information on Apache's error pages there and how to customize them. This is literally documentation from Apache on how to change their error documents.

If you're looking for their location you can find it here:
Code:
[root@server ~]# ls -lah /var/www/html/
total 56K
drwxr-xr-x 4 root root 4.0K Aug 20 12:12 .
drwxr-xr-x 4 root root 4.0K Aug 20 12:12 ..
-rw-r--r-- 1 root root  229 Jan 29  2019 400.shtml
-rw-r--r-- 1 root root  207 Jan 29  2019 401.shtml
-rw-r--r-- 1 root root  203 Jan 29  2019 403.shtml
-rw-r--r-- 1 root root  204 Jan 29  2019 404.shtml
-rw-r--r-- 1 root root  216 Jan 29  2019 413.shtml
-rw-r--r-- 1 root root  243 Jan 29  2019 500.shtml
-rw-r--r-- 1 root root  11K Jan 29  2019 cp_errordocument.shtml
-rw-r--r-- 1 root root  163 Jan 29  2019 index.html
drwxr-xr-x 2 root root 4.0K Jul  6  2018 suspended.page
drwxr-xr-x 3 root root 4.0K Jul  6  2018 .well-known
[root@server ~]#
Though, again neither cPanel nor Apache recommends you modify these directly.
 

Rajeeva Lochana

Well-Known Member
Community Guide Contributor
May 27, 2019
122
39
28
India
cPanel Access Level
Root Administrator
Apologies you did not understand, I understand I am not clear here. Let me come clear.
For example:-
You have a error page set using the error document directive in .htaccess or error document.conf. If the error document specified there does not exist, there is an error like this:-

Not Found
The requested URL was not found on this server.

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


How do I change this automatically generated error document, is this located anywhere? I don't want to override it.
 
Last edited:

Rajeeva Lochana

Well-Known Member
Community Guide Contributor
May 27, 2019
122
39
28
India
cPanel Access Level
Root Administrator
I have found out that this error page is set in the Apache's Source Code, which I do not want to modify, cuz I am not sure if I am permitted to.
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
I won't delete it as the process can be helpful for others if they want to change a different page. The note that you did not think it relevant to change this page after all should be notice enough to let others know.
 

Rajeeva Lochana

Well-Known Member
Community Guide Contributor
May 27, 2019
122
39
28
India
cPanel Access Level
Root Administrator
Oh yeah, nice. I just didn't want some things that I thought was not useful. But let there be everything anyways. The fix for my problem was in the Apache source code itself, which I don't know if I have permission to edit.
 
  • Like
Reactions: cPanelLauren