使用urlrewritefilter从url中删除文件

时间:2012-04-05 07:45:44

标签: url-rewriting tuckey-urlrewrite-filter

我有一个像www.foo.com/start/rewrite.php/home/say/index

这样的网址

如何使用UrlRewriteFilter从此网址中删除rewrite.php,例如

www.foo.com/start/home/say/index

我认为mod_rewrite可以与

一起使用
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/start/rewrite.php/?(.*) /$1 [R=301,L] 

任何人都可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

这可行:

<rule>
    <from>^(.*)/(rewrite.php)/(.*)$</from>
    <to>$1/$3</to>
</rule>