2015-06-10 91 views
-1

所以我可以處理一個文件forums.php都forums.php?CATEGORY_ID = X和forums.php?topic_id = X多參數NGINX重寫

當重寫URL來論壇/ CATEGORY_ID/X和forums/topic_id/XI無法使其工作。 Nginx的理解有兩個獨立的參數。這裏是我現在有:

rewrite ^/forums/(.*)$ /forums.php?topic_id=$1 last; 
rewrite ^/forums/(.*)$ /forums.php?category_id=$1 last; 

它不能得到id在最後,只是在SQL查詢返回空...任何人都可以幫助嗎?

回答

0

而且想通了......

rewrite ^/forums/topic_id/(.*)$ /forums.php?topic_id=$1 last; 
rewrite ^/forums/category_id/(.*)$ /forums.php?category_id=$1 last;