mod rewrite problem?

Tag: apache , mod-rewrite Author: duizhang42111 Date: 2009-09-19

I am facing a problem using mod_rewrite. This is what I am using

Options +FollowSymLinks
RewriteEngine on
RewriteRule pc/$ /pc.php

to rewrite to
This is working perfectly fine but, when I go to a domain such as it is showing the pc.php page.
What am I doing wrong here and how can I eliminate this problem? Thanks

Best Answer

You need to anchor the match to the start of the URL:

# If you're using .htaccess
RewriteRule ^pc/$ /pc.php

# If you're using httpd.conf
RewriteRule ^/pc/$ /pc.php