Home » Categories » Multiple Categories | ||||
How to Change the Apache Error Messages |
||||
Article Number: 104 | Rating: Unrated | Last Updated: Fri, Feb 25, 2022 at 11:49 AM
|
||||
You can change the Apache error messages for a single app by adding ErrorDocument directives to the app's .htaccess file. For example, any of these formats work: ErrorDocument 403 "Sorry, access to this page is forbidden." To change the error pages globally, log in as root and create the following file: /etc/apache-sp/conf.d/errors.conf ErrorDocument 403 "Sorry, access to this page is forbidden." sudo service apache-sp restart Changing 404 Error Messages ErrorDocument 404 /404.php However, this ErrorDocument directive will not catch 404 errors for requests that end in .php themselves. For example, a request for /this-does-not-exist.php will not be handled by the ErrorDocument directive because the request ends in .php. To handle 404 errors for requests that end in .php, you should use rewrite rules that direct those requests to a specific PHP script, which will then send a 404 response. To show a custom 404 page (using a file named 404.php, for example) when a requested script doesn't exist, add the following to your app's .htaccess file: RewriteRule ^404\.php$ - [L] <?php
Ref:
|
||||
| ||||
Attachments
There are no attachments for this article.
| ||||
Comments There are no comments for this article. Be the first to post a comment. | ||||
PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
Viewed 1843 times since Mon, Sep 28, 2020
PHP Warning: PHP Startup: Unable to load dynamic library ’curl’
Viewed 813 times since Thu, Feb 3, 2022
"End of script output before headers" in Apache + PHP
Viewed 646 times since Sun, Feb 27, 2022
Apache - Internal Server Error - LimitInternalRecursion
Viewed 469 times since Thu, Mar 10, 2022
PageSpeed: Enable Keep-Alive
Viewed 407 times since Tue, Mar 1, 2022
Hide X-Powered-By: PHP
Viewed 615 times since Tue, Sep 15, 2020
Server error: Connection reset by peer | End of script output before headers
Viewed 2684 times since Mon, Feb 28, 2022
|