在Linux Apache2上找不到CodeIgniter URL文件 [英] CodeIgniter URLs File not found on Linux Apache2
本文介绍了在Linux Apache2上找不到CodeIgniter URL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法使我的控制器在Linux apache2上运行(从WAMP转移)
Cannot get my controllers working on Linux apache2 (transferred from WAMP)
config.php
$config['base_url'] = 'http://subdomain.domain.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
apache2日志
[Tue Sep 23 03:36:08 2014] [error] [client 192.168.1.1] File does not exist: /var/www/subdomain.domain.com/execute
apache2 conf
<VirtualHost *:80>
ServerName subdomain.domain.com
DocumentRoot /var/www/subdomain.domain.com
<Directory /var/www/subdomain.domain.com>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
不确定是什么问题.
推荐答案
将.htaccess文件更改为此:
Change your .htaccess file to this:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
在您的配置文件中,尝试以下操作:
In your config file, try this:
$config['uri_protocol'] = 'AUTO';
那可能会帮你解决问题.
That might fix you up.
这篇关于在Linux Apache2上找不到CodeIgniter URL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文