Aucist Others give up, I insist
I'm a programmer, simply I'll introduce that how does .htaccess file work. First of all, I suggest that create a virtual hosting on local harddisk for your site to test, please view this I wrote http://www.auciou.com/peace/80 (How to create a virtual hosting on local harddisk.)
If you want to test .htaccess file on local harddisk, you must create a virtual hosting on local harddisk first. Why? Because once you use the 404 Error page, the root directory must be your site's folder. So it's very convenient to create virtual hostings on local harddisk.
.htaccess file takes effect for its folder, and its subfolder, and sub-subfolder, etc., so I suggest that if the functions of your site's folders are different, you can create a .htaccess file for every folder which you need to use 404 error page. Such as this blog, and this article's URL is http://www.ausue.com/dedicate/7, I create a folder "dedicate" and I create a .htaccess file at F:siteausue.comdedicate.htaccess, don't create it at F:siteausue.com.htaccess. The .htaccess file at F:siteausue.comdedicate.htaccess just write this one sentence:
ErrorDocument 404 /dedicate/abc.php
The program file is abc.php. This is a 404 error page example, and at first of abc.php, should write this one sentence:
header("Status: 200 OK");
If you use Rewrite mod, you needn't to write this sentence above. When upload this program to your site, you should check its status code. If it's 200 OK, it's normal. If it's 404 Not Found, you should continue checking your PHP program. The picture of this example as below:
A Rewrite example: create a .htaccess file at the same directory with the program file. Then write these 2 lines:
RewriteRule (.+) abc.php
Such as one of my Blog programs:
Then you can access the web page as http://www.aucist.com/commence/trackback/8
Can students use mobile phones?
My university campus life
Finding the meaning of happiness
It is never too late to learn
American musical talents
Idols should represent positive aspects
How about being a parent at an early age?
Work supports your dreams
Why do girls need to work so hard?