【发布时间】:2012-03-28 04:58:30
【问题描述】:
如果我注释掉另一个,文件中的每个规则都可以正常工作,但是它们两个一起不能达到任何目的,反而会使网站变得丑陋。关于如何解决这个问题的任何建议?谢谢。
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# If the request is for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
# If the request is for a valid link
RewriteCond %{REQUEST_FILENAME} !-l
# do not do anything
RewriteRule ^ - [L]
# forward /blog/foo to blog.php/foo
RewriteRule ^blog/(.+)$ blog.php/$1 [L,NC]
# forward /john to user_page/profile.php?name=john
RewriteRule ^((?!blog/).+)$ user_page/profile.php?uid=$1 [L,QSA,NC]
【问题讨论】:
标签: php apache .htaccess mod-rewrite