htaccess文件没有给出期望的结果

My project's directory structure is as follows:

localhost/proj1
-folder1
-folder2
-.htaccess
-header.php
-index.php
-about_us.php
-contact_us.php

In the header page, hyperlink to open about_us.php is like <a href="about/">About Us</a>.Similarly for Contact us page it is <a href="contact/">Contact us</a>.The contents of my htaccess file is as follows:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^about/ about_us.php
    RewriteRule ^contact/ contact_us.php
RewriteRule .* 404.php [L]
</IfModule>

In the above file when i remove rewrite rule for 404 error, the rule for about us & contact us works properly.However when i don't remove the rule for 404 error then the the link for about us and contact us dont work instead pages are redirected to 404.php. Why is it behaving like that??How to include rules for 404 file not found error??Please help as i am new to htaccess.

Don't know what are you trying to do exactly. Ok, if you want to handle the 404 error, just create a 404.php file, and add this to your .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^about/ about_us.php [L]
RewriteRule ^contact/ contact_us.php [L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]

ErrorDocument 404 /404