我一直在本地开发一个Codeigniter网站,在Windows上使用WAMP服务器,一切正常。我将文件上传到Ubuntu服务器到虚拟目录,并配置URL和.htaccess。重写规则的工作方式应该如此,但现在当我尝试访问该站点或任何其他控制器链接时,我得到404。日志表明它找不到控制器,我检查了文件以确保它们被正确上传。
此时我不知所措,我有一种预感,这是Apache的配置问题,但我检查了所有我知道的配置。什么会导致404错误?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>