[英]codeigniter The requested URL /User was not found on this server
i Have codeigniter 3.0.1 installed in ubuntu 14.04 apache 2.4.7, it was run normally in windows with wamp server but when i move it to the ubuntu server it keep getting that error,the rewrite module already enabled and this is my .htaccess file: 我在ubuntu 14.04 apache 2.4.7中安装了codeigniter 3.0.1,它在带有wamp服务器的Windows中正常运行,但是当我将其移至ubuntu服务器时,它不断出现该错误,重写模块已启用,这是我的.htaccess文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
and this is the configuration of config.php 这是config.php的配置
$config['base_url'] = 'http://assets1.uofk.edu';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
this is routes.php configuration: 这是routes.php配置:
$route['default_controller'] = 'User';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
Also i considered the ubuntu case sensitive matter of naming model but still getting not found error..please help 我也考虑了命名模型的ubuntu区分大小写的问题,但仍然找不到错误..请帮助
try check your .htaccess change 尝试检查您的.htaccess更改
RewriteRule ^(.*)$ index.php?/$1 [L]
and check your config.php 并检查您的config.php
$config['base_url'] = 'http://assets1.uofk.edu/';
$config['index_page'] = '';
and check your controller name must be User.php and on your class must User 并检查您的控制器名称必须为User.php,并且在您的类中必须为User
Use this .htaccess 使用此.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ index.php?x=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ index.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^(.*)$ index.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^(.*)$ index.php/$1 [QSA,NC,L]
and this is the configuration of config.php 这是config.php的配置
$config['base_url'] = 'YOUR_URL';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
.htaccess RewriteRule Examples https://www.brontobytes.com/knowledgebase/149/htaccess-RewriteRule-Examples.html .htaccess RewriteRule示例https://www.brontobytes.com/knowledgebase/149/htaccess-RewriteRule-Examples.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.