2012-02-07 47 views
1

如果用戶位於第1-15頁,我正在使用以下3條重寫規則加載靜態緩存文件。有沒有辦法將這些結合起來,特別是最後2分成1條規則?我一直無法找到任何方式來指定範圍1-15。與數字匹配的Mod RewriteRule 1-15

RewriteRule ^$ app/webroot/cache_html/cache_static_popular_results_1.php [L] 
RewriteRule ^popular/page:([1-9])$ app/webroot/cache_html/cache_static_popular_results_$1.php [L] 
RewriteRule ^popular/page:(10|11|12|13|14|15)$ app/webroot/cache_html/cache_static_popular_results_$1.php [L] 

回答

2

有沒有一種方法,我可以結合這些,特別是最近2到1條規則

如何

RewriteRule ^popular/page:([1-9]|1[0-5])$ app/webroot/cache_html/cache_static_popular_results_$1.php [L] 
+1

除了OP不想要匹配'流行/頁面:0'所以單個數字範圍應該是'[1-9]':-) – TerryE 2012-02-07 13:22:58

+0

@TerryE謝謝 - 你是正確的,我已經修復它。 – 2012-02-07 13:46:30