重写为非Web可访问的脚本

时间:2014-05-06 15:48:16

标签: apache .htaccess mod-rewrite rewrite

我有一个脚本,多个客户端(具有不同的域)在同一台服务器上使用。出于这个原因,我想将该脚本的任何请求重写到服务器上的文件中:

RewriteBase    /base/
RewriteRule    ^index\.htm$  /file/location/index.cgi [QSA]

然而,这不起作用。我想这可能是因为Apache要求您从当前域重写到Web可访问文件夹。有谁知道做我想要的好方法?谢谢!

1 个答案:

答案 0 :(得分:1)

在apache配置中使用Alias(不是htaccess)http://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias