2010-01-27 24 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使它工作。