0
爲什麼不會http://mysite.com/threads/add
轉到post.php?相反,它只能顯示main.php不管我寫線程/重寫程序幫助
RewriteRule threads/? /forum/main.php
RewriteRule threads/add$ /forum/post.php
爲什麼不會http://mysite.com/threads/add
轉到post.php?相反,它只能顯示main.php不管我寫線程/重寫程序幫助
RewriteRule threads/? /forum/main.php
RewriteRule threads/add$ /forum/post.php
當與「/線程」的任何一個請求時,它被改寫爲「/forum/main.php」之後。由於「/forum/main.php」與你的第二個RewriteRule不匹配,它會被跳過。
做你期待什麼,你應該a)命令優先順序您的RewriteRules,和B)錨你的比賽,像這樣:
RewriteRule ^/threads/?$ /forum/main.php
RewriteRule ^/threads/add$ /forum/post.php
老實說,那些可能被清理,也變得更加靈活。