【问题标题】:CodeIgniter 404 page routes on SuSeSuSe 上的 CodeIgniter 404 页面路由
【发布时间】:2017-01-19 19:39:17
【问题描述】:

我正在尝试将我的网站上传到服务器,这是 Suse 13。我已经安装了 Apache2.4 和 PHP 5.6。在 Windows 中,同样的网络运行良好,但在 Suse 上却不行。如果我在方向栏http://myip/myweb/index.php/ControllerName/MethodName 上写,它可以工作,但路由不工作。

我有一个大写字母Controller.php的控制器文件,里面的类名是Controller,方法是“method”,小写。在 routes.php 我有:

$route['default_controller'] = 'controller';
$route['bar/foo'] = 'controller/method';

我的 config.php 文件:

$config['base_url'] = 'http://myip/myweb/';
$config['index_page'] = ''; //I can see the index page correctly
$config['uri_protocol'] = 'REQUEST_URI';

最后,我的 .htaccess 文件:

RewriteEngine On
ServerSignature Off

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?
 </IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE model/vnd.collada+xml
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

我需要帮助,我不知道该怎么办......

谢谢!

编辑:

在 apache 中启用模块:

actions alias auth_basic authn_file authz_host authz_groupfile authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir php5 reqtimeout authn_core authz_core version man rewrite

【问题讨论】:

    标签: .htaccess codeigniter http-status-code-404 suse


    【解决方案1】:

    各位,如果你想知道f***错在哪里,你必须知道在Apache配置文件中你必须添加AllowOverride All!!!

    http://enarion.net/web/htaccess/mod_rewrite-on-suse/

    【讨论】:

      猜你喜欢
      • 2019-08-02
      • 2013-08-31
      • 2013-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-02
      相关资源
      最近更新 更多