整个目录的Apache重写规则

时间:2012-05-18 20:53:00

标签: apache mod-rewrite

我想提出重写规则

RewriteRule /test /my/long/path/index.html

但我的index.html通过ajax获取其他文件,所以它不像这样简单。我需要一个规则用于目录
的所有子文件 我试过了:

RewriteRule /test /my/long/path/
RewriteRule /test/* /my/long/path/*

但我最终得到了一个有趣的重定向http://my.domain.co/test/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/

对不起我在Apache中的无知,以及thx

1 个答案:

答案 0 :(得分:2)

您的RewriteRule无效。试试这个:

RewriteRule ^test(/.*)?$ my/long/path$1
相关问题