mod rewrite problem?
I am facing a problem using mod_rewrite. This is what I am using
Options +FollowSymLinks
RewriteEngine on
RewriteRule pc/$ /pc.php
to rewrite http://www.example.com/pc/ to http://www.example.com/pc.php.开发者_开发问答
This is working perfectly fine but, when I go to a domain such as http://www.example.com/news/today-in-pc/ it is showing the pc.php page. What am I doing wrong here and how can I eliminate this problem? ThanksYou 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
精彩评论