2010-01-27 77 views
0

我使用Apache 2.2.6与suPHP 0.6.2和PHP 5.2.6,我试图使用别名以便通过PHP脚本路由所有请求。我想要所有的请求/测试通过index.php。在Apache虚拟主机配置中,我设置了别名Alias /test /index.php。 index.php文件仅仅是包含以下内容的虚拟脚本:别名Apache中的URL,以便通过PHP脚本在某个URL上路由请求

<?php 
phpinfo(); 
?> 

请求http://localhost/index.php作品,并给出了预期的输出,但要求http://localhost/test不和,给了我一个403错误,error.log中包含以下内容:

[Wed Jan 27 17:13:19 2010] [error] [client 127.0.0.1] client denied by server configuration: /index.php 

我的别名有什么问题?

编辑: 我差点忘了提,重写/测试通过的mod_rewrite到的index.php工作为好,但我想避开我的生产服务器上的mod_rewrite如果可能的话。

回答

0

别名需要绝对路径,所以Alias /test /var/www/index.php使它工作。