【发布时间】:2014-08-21 15:50:46
【问题描述】:
我在 Windows 上编写了我的 Web 应用程序,并将其推送到运行 Ubuntu Linux 的服务器上。这是我的 .htaccess 文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /SearchDatGifUbuntu/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 /index.php
</IfModule>
我在 /etc/apache2/sites-available/default 的文件如下:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
我在我的 ubuntu 服务器的命令行中输入了 sudo a2enmod rewrite,它说 mod_rewrite 已经打开。
当我通过我的 codeigniter 应用程序进行调试时,错误似乎出现在 CodeIgniter.php 的第 308 行,即:
$CI = new $class();
谁能告诉我这是怎么回事?
【问题讨论】:
-
尝试将
AllowOverride FileInfo与Require all granted改为stackoverflow.com/a/22526144/661872
标签: php .htaccess codeigniter mod-rewrite ubuntu