How do I redirect users who go to a non-existent page to a default error page?
If a user tries to access a page that does not exist, the web server generates a 404 File Not Found error. By default, the server will display a generic error page to the user. You can replace this page with your own custom page by using the ErrorDocument directive in your .htaccess file. First, you must create the page you want to display. This can be a CGI script or an HTML file. Place this file somewhere on your web. In your web root directory, edit or create an .htaccess file (including the dot at the beginning of the name) and add the line: ErrorDocument 404 http://www.yourdomain.com/myerror404page.html (replace yourdomain.com with your domain name) This method also works with other error codes (500, 403, 302, 401, etc.). Beware that with the 401 Authorization Required error, the document must be local so your line would look something like: ErrorDocument 401 /myerror401page.html More information about customizing your error responses can be found at the Apache Server document pag
Related Questions
- When I click Users and Organizations page under Group Approval, an error message, the organization chart is inconsistent, appears. What is the reason and resolution for this problem?
- Why do I get an error when I try to enumerate Active Directory (AD) users through the User Managers AD page, or why does AD authentication take so long?
- How do I set the page that users see when they logout? It is set by default to the Oracle9iAS Portal Welcome page?