我正在使用 Yii 框架创建一个网站并试图隐藏入口脚本。在我的本地(MAMP)服务器上一切正常,但是当我将它部署到我的 Uni 的 Linux 服务器上时,我遇到了问题。我想它与 相关UserDir
,但我不确定。
当我请求时:http://website/username/site/research
我得到:
The requested URL /~home/username/public_html/index.php was not found on this server.
我的.htaccess
样子是这样的:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^.*$ index.php
我不知道从哪里开始调查这个问题。可以与UserDir
吗?还是用我的.htaccess
and mod_rewrite
?或配置Yii
?