【发布时间】:2014-10-17 15:40:29
【问题描述】:
我想像这样用 mod_rewrite 重写 URL:
example.com/path/foo/rest_of_path-> example.com/path/rest_of_path (remove foo)
example.com/path/bar/rest_of_path-> example.com/path/rest_of_path (remove bar)
example.com/path/sample/rest_of_path-> no rewriting<br/>
example.com/path/test/rest_of_path-> no rewriting
foo, bar 是动态的 test, sample 是静态的,我有路径列表。
所以我正在考虑这样做(在我的 httpd.conf 中):
RewriteCond ....... #it's here i'm blocking, how write only if $1 in test,sample ?
RewriteRule ^path/(.\*)/(.*)$ /path/$2
【问题讨论】:
标签: apache mod-rewrite url-rewriting