如果我註釋掉其他文件,文件中的每個規則都可以正常工作,但是它們中的兩個並沒有達到其中的任何一個目的,而是使網站變得醜陋。有關如何解決此問題的任何建議?謝謝。如何解決此.htaccess文件中的規則衝突?
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]
+1全力以赴。但是我已經在你的代碼中做了一個小修改,並且冒昧地編輯你的答案。 – anubhava 2012-03-27 20:56:36
@anubhava,再次感謝。 – Chibuzo 2012-03-28 12:12:58