Hello everyone.
Hoping that someone can point me in the right direction here.
I have a vps and full root access. Running the latest version of whm/cpanel: Apache/2.4.29 - CENTOS 6.9 68.0.21
So I updated a site to php 7.1. All working beautifully and love the increased performance over php 5.6
I just addressed some 404 issues and on looking at my logs I saw that there were quite a few hits to domain.com/403.shtml/ which were going to 404 on my wordpress install.
Investigating I saw that this is a custom error file from cpanel.
Firstly I addressed why it was going to 404 as there was / in front (issue with cache plug-in which is fixed now) and also the file itself didn't exist. So I went to error pages in cpanel and saved some example text.
once I did that it created the relevant shtml in public_html i then also updated my .htacces and added this: ErrorDocument 403 default
I then tried a file which required access and it shows the default forbidden message and not the shtml file content I was expecting.
I can navigate to the 403.shtml file and can see it no issues with my custom content. I know that I can also update my htaccess addition to point to this shtml file.
However when I checked the status code of the custom 403.shtml file it shows a 200 response code?! surely that's not right? should it and how can I get it to show the correct error code?
Is the only way to do this is create a manual file (php) and add in headers to that php file and then use that for my 403 (and other) error pages?
I was expecting this: create custom *** error page. Update htaccess to include the location to it and voilà it works. However it wouldn't have the right header response I was expecting i.e. 403 forbidden.
Is this a bug? or have I missed something here??
Hope all the above makes sense and looking forward to your expert replies.
Thanks.
Hoping that someone can point me in the right direction here.
I have a vps and full root access. Running the latest version of whm/cpanel: Apache/2.4.29 - CENTOS 6.9 68.0.21
So I updated a site to php 7.1. All working beautifully and love the increased performance over php 5.6
I just addressed some 404 issues and on looking at my logs I saw that there were quite a few hits to domain.com/403.shtml/ which were going to 404 on my wordpress install.
Investigating I saw that this is a custom error file from cpanel.
Firstly I addressed why it was going to 404 as there was / in front (issue with cache plug-in which is fixed now) and also the file itself didn't exist. So I went to error pages in cpanel and saved some example text.
once I did that it created the relevant shtml in public_html i then also updated my .htacces and added this: ErrorDocument 403 default
I then tried a file which required access and it shows the default forbidden message and not the shtml file content I was expecting.
I can navigate to the 403.shtml file and can see it no issues with my custom content. I know that I can also update my htaccess addition to point to this shtml file.
However when I checked the status code of the custom 403.shtml file it shows a 200 response code?! surely that's not right? should it and how can I get it to show the correct error code?
Is the only way to do this is create a manual file (php) and add in headers to that php file and then use that for my 403 (and other) error pages?
I was expecting this: create custom *** error page. Update htaccess to include the location to it and voilà it works. However it wouldn't have the right header response I was expecting i.e. 403 forbidden.
Is this a bug? or have I missed something here??
Hope all the above makes sense and looking forward to your expert replies.
Thanks.