【发布时间】:2013-07-28 10:01:30
【问题描述】:
我在这里和网络的其他地方浏览了许多资源,但似乎无法使其工作。 我在主目录中有 codeigniter 应用程序。符号链接在 /var/www/html 中创建。 下面的链接可以正常工作。
http://mydomain.net/dms/index.php/welcome
但是没有 index.php ,我希望下面的链接可以工作
http://mydomain.net/dms/welcome
代码点火器 2.1.1 目录:
dms
application
system
index.php
.htaccess
配置.php
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";
routes.php
$route['default_controller'] = "welcome";
配置文件 httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
Alias /dms/ "/var/www/html/dms/"
<Directory "/var/www/html/dms">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
符号链接
ls -l /var/www/html
dms -> /home/user1/dms
.htaccess 文件:
RewriteEngine On
# enable symbolic links
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+) index.php [L]
我尝试将 .htaccess 文件保存在 CI 文件夹文件夹 /home/user1/dms 中,稍后保存在 /var/www/html 中 两者都没有工作。 我收到错误(在 http 错误日志中)
"File does not exist: /var/www/html/dms/welcome"
请帮忙。
【问题讨论】:
-
.htaccess 文件由下面的 Christian Giupponi 给出,我在 cmets 中提到的更正有效。不需要服务器级别的 AllowOverride All,但必须在特定目录级别。谢谢
标签: codeigniter