RewriteMap指令(永久或临时redirect?)

这可能听起来像一个愚蠢的问题,我可能混合苹果和橙子,但请忍受我。

我正在阅读这里的文档http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#mapfunc

它说当使用外部.txt文件格式是一个简单的键/值对的例子:

fromHere.html toHere.html

^我想确认,上述将创build一个临时302redirect(该浏览器不会积极caching),或者可能是我可以指示redirect的types(301/302)在实际的RewriteRule中htaccess文件? (如果是的话)?

目前,我在.htaccess文件中使用了以下语法

将302从Here.htmlredirect到Here.html

上述语法是否允许在外部.txt文件中?

谢谢

重写不等于redirect! 从使用RewriteMap :

RewriteMap指令定义了一个外部函数,它可以在RewriteRuleRewriteCond指令的上下文中调用,以执行过于复杂的重写,或者仅仅通过正则expression式来执行重写。

重写的types被定义为RewriteRule指令中的一个标志 ,语法:

 RewriteRule Pattern Substitution [flags] 

大部分重写都是在服务器端静静地完成的,而浏览器甚至不知道它。 对于外部302redirect,你需要标志R=302

redirect|R[=code]

强制外部redirect,可选地使用指定的HTTP状态码。

您在.htaccess中使用的Redirect指令与mod_alias相关,而不是mod_rewrite ,与RewriteMap无关。