The difference between Apache's Rewrite and 404 error pages is

  

Rewrite and 404 error pages have their own advantages. Some of their differences:

1, 404 error page advantage may be that there is no need to call the Rewrite module, Rewrite needs to call this module. So 404 error pages may be more resource efficient and make larger sites faster. Most of the static web pages I've written are currently using 404 errors.

2, using the 404 error page, can not be POST and GET. For example, 305.php?name1=auiou, if the 305.php page is generated with a 404 error, the value of this $_GET["name1"] will not be read. The other page's <form> uses the POST method to point the action to the 305.php generated by this 404 error, and cannot be received. For example, the information sent by <form method=post action=305.php> cannot be received by 305.php. .
If you want to generate a virtual path such as 305.php is POST and GET, use Rewrite to solve.

3, computer software and hardware application network (http://www.45it.com) found that the beginning of the 404 error page has some Linux space must be written to this sentence Rewrite needs to write a statement, I have not tested it.

4, 404 error page rules are relatively less strict, so there is a better range of adaptation. Rewrite is relatively stricter, for example, 305.html and 305-1.html need to write 2 rewrite rules; use 404 error page as long as a rule. This is another important reason why I use 404 errors instead of Rewrite.

Copyright © Windows knowledge All Rights Reserved