频道栏目
首页 > 资讯 > CodeIgniter > 正文

codeigniter按正常URL规则访问500错误

16-01-08        来源:[db:作者]  
收藏   我要投稿

在nginx环境下CI框架默认URL规则访问不了,出现500错误,如:

http://blog.php230.com/index.php/keywords
今天在服务器配置CI框架环境时,去除URL中的index.php,出现了默认URL规则访问不了的情况,只能通过参数方式访问:
http://blog.php230.com/index.php?c=keywords
配置:
location /{
	if (-f $request_filename) {
		expires max;
		break;
	}
	if (!-e $request_filename) {
		rewrite ^/(.*)$ /index.php/$1 last;
		break;
	}
}

自己在lnmp测试环境下使用正常,在正式服务器上就不能使用。

解决方法:

location /{
	try_files $uri $uri/ /index.php?$uri&$args;
}
把重写规则改为上面就可以正常访问了。
相关TAG标签
上一篇:Codeigniter出现Unable to connect to your database server using the provided settings错误解决办法
下一篇:CodeIgniter文件上传错误:escapeshellarg() has been disabled for security reasons
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站