uffix is used to specify the file suffix that contains Meta data.
# Errordocument. nbsp500 "The server made a boo.
# Errordocument. nbsp404/missing.html
# Errordocument. nbsp404/cgi-bin/missing_handler.pl
# Errordocument. nbsp402
Http://some.other _ server.com/subscription_info.html
If the requested webpage doe
1. Configure. htaccess Custom Error page
The first application of the. htaccess is to customize the error page, which will allow you to have your own, personalized error page (for example, when you can't find a file), not the error page that your service provider offers or no pages. This will make your site look more professional when it goes wrong. You can also use a script to notify you when something is wrong (for example, I use the PHP script for free webmaster Help, and automatically email
. htaccess syntax to easily complete this function. (Put. htaccess in the root directory of your website)
ErrorDocument 401/error/401.php
ErrorDocument 403/error/403.php
ErrorDocument 404/error/404.php
ErrorDocument 500/error/500.php
2. Set the time zone of the website
SetEnv TZ America/Houston
3. Blocked IP list
) Plain text#ErrorDocument "The server made a boo boo.# Note: The first "number" is used to indicate the text, not actually output## 2 Local redirection#ErrorDocument 404/missing.html# to redirect to the local url/missing.html#ErrorDocument 404/cgi-bin/missing_handler.pl# Note: A script or document that can be redirected to any server-side## 3) External redirecti
structure.
Indexes is used to display the directory structure when there is no index.html file in the directory.
2. Restart the Apache service.
3. You can set/etc/httpd. conf.
To delete the Indexes settings of Options.
6. Error Page redirection
Apache error page redirection
1. Modify the httpd. conf configuration file:
ErrorDocument 400/custom400.html
ErrorDocument 401/custom401.html
The 404 page tells the search engine that the page does not exist and also prompts you to select other operations, next, I will introduce the operation methods for customizing the 404 page in php to my friends who do not have the apache operation permission.
Method 1
The Code is as follows:
Copy code
@ Header ("http/1.1 404 not found ");@ Header ("status: 404 not found ");Echo 'echo 404 ';Exit ();
Load a 404 error page
The Code is as follows:
Copy code
characters when parsing Chinese webpages,Modify adddefadefacharset ISO-8859-1 to adddefacharcharset GB2312(3). modify the default homepageApache automatically imports the home page when accessing the directory. the priority is based on the order of priority.Change DirectoryIndex index.html. varDirectoryIndex index.html index. jsp index. php default. jsp default. php index.html. var(4). set error pageIn this way, your website will be safer. if you do not set it, if you enter a path after your we
the file location (. htpasswd) for saving the user name and password. In this example, it refers to the. htpasswd file, which is in the same location as our. htaccess file.
Require valid-user specifies that only valid users in the. htpasswd file can access the service.1.1.2. htpasswd Configuration
User name: Password
Aaa: aaa
Not necessarily in. the configuration in the htaccess file can also be found in httpd. conf (Master configuration) to improve the efficiency of apache. Otherwise, Apache
home page when accessing the directory. the priority is based on the order of priority.Change DirectoryIndex index.html. varDirectoryIndex index.html index. jsp index. php default. jsp default. php index.html. var(4). set error pageIn this way, your website will be safer. if you do not set it, if you enter a path after your website, the error 404 will be displayed.The version number of your server is displayed, and the server configuration is clear at a glance. to avoid this situation, you can
404 page is a tell the search engine this page does not exist, but also prompted the user can choose other operations, below I give no Apache operation rights to introduce a friend PHP custom 404 page Operation method.
Method One
The code is as follows
Copy Code
@header ("http/1.1 404 Not Found");@header ("status:404 not Found");echo ' echo 404 ';Exit ();
Loading a 404 error page
The code is as follows
Copy Code
@header ("http/1.1
The 404 page tells the search engine that the page does not exist, and also prompts users to select other operations. next I will introduce php custom 404 to my friends who do not have apache operation permissions.
The 404 page tells the search engine that the page does not exist and also prompts you to select other operations, next, I will introduce my friends who do not have the apache operation permission to the operations on the custom 404 page in php.
The instance code is as follows:
@
be safer. If you do not set it, if you enter a path after your website, the Error 404 will be displayed.The version number of your server is displayed, and the server configuration is clear at a glance. To avoid this situation, you can set an error page.When a 404 error occurs, that is, the webpage cannot be found, the visitor is imported to an error page.Find:## Customizable error responses come in three flavors:#1) plain text 2) local redirects 3) external redirects## Some examples:#
Label:404 errors can be written like thisErrorDocument Code error.phpIf it is a 404 error, skip to file error.phpOther common error page notation (where 404 errors have 2 ways of writing, the above one, the following is a generic error definition)ErrorDocument 404/error/404.php
errordocument 500/error/500.php
errordocument 400/error/400.php
addiconbytype# Is used to set the graph list used to display different file types. For each column# The output file type. The first matching graph is displayed.Addiconbytype (VID,/icons/movie.gif) Video /*Addicon/icons/binary.gif. bin. exe
# Default file illustrationDefaulticon/icons/unknown.gif
# If a problem or error occurs, you can configure Apache for four responses.#1. Output custom (mizmized) messages (text)# Errordocument 500 "the server made
PHP Error Interface detailed instructions, PHP error details
One of the most common errors on the Web is the invalid link. Once an invalid link appears from another site, you will reschedule yourof the site. People will store their favorite sites in a book, if they visit again after three months, only to find that ' 404 Not fount ', they will not be given the task help and tell them how to find the original information from your site. Let's solve this problem, or at leastGive your users a frien
index.html index.htm index.shtml index. cgi
The Chinese character set is used by default.
Adddefacharcharset gb2312
Add error redirection, so that when the following error occurs, the user will be redirected to the page you specified
ErrorDocument 404 http://secu.zzu.edu.cn/index.php
ErrorDocument 402 http://secu.zzu.edu.cn/index.php
ErrorDocument 403 http://sec
Introduction: This is a detailed page for PHP custom 404 errors. It introduces PHP related knowledge, skills, experiences, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 322981 'rolling = 'no'> I have been developing a website and have never known how to customize the 404 error page in PHP. Today I finally figured it out, which is very simple.
Create a self-built 404 error page in the WWW file in the PHP environment.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.