Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 重写为不可通过web访问的脚本_Apache_.htaccess_Mod Rewrite_Rewrite - Fatal编程技术网

Apache 重写为不可通过web访问的脚本

Apache 重写为不可通过web访问的脚本,apache,.htaccess,mod-rewrite,rewrite,Apache,.htaccess,Mod Rewrite,Rewrite,我有一个脚本,多个客户端(具有不同的域)在同一台服务器上使用。因此,我想将对该脚本的任何请求重写到服务器上的文件中: RewriteBase /base/ RewriteRule ^index\.htm$ /file/location/index.cgi [QSA] 然而,这不起作用。我认为这可能是因为Apache要求您从当前域重写到一个可通过web访问的文件夹。有人知道做我想做的事的好方法吗?谢谢 在apache配置中使用别名(不是htaccess)您只能重写到Document

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

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

然而,这不起作用。我认为这可能是因为Apache要求您从当前域重写到一个可通过web访问的文件夹。有人知道做我想做的事的好方法吗?谢谢

在apache配置中使用别名(不是htaccess)

您只能重写到
DocumentRoot