Apache ForceType或RewriteRule

时间:2012-02-09 03:45:42

标签: apache mod-rewrite

如果我有 abc.php 文件,但我希望通过网络将其作为 js 文件进行访问,例如 http://xyz.com/abc.js?m=1&x=3 为此目的Apache的 ForceType 更好OR RewriteRule ???

我知道两者都有效,但想知道哪一个是正确的。哪一个在速度方面表现更好。

1 个答案:

答案 0 :(得分:0)

为此,我更喜欢RewriteRule,因为你不强迫所有的php文件充当js

RewriteRule ^ /?abc.js。* $ http://xyz.com/abc.php?$ 1 [PT,L]应该可以正常工作。

相关问题