默认情况下CI 不支持路由模式需要在server里面配置,配置成如下即可:

server
{
listen 80 ;
server_name wechat.XX.com.cn;
root XX;
index index.html index.php;
location ~ \.php($|/) { fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} if (!-e $request_filename) {
rewrite "^/(.*)$" /index.php last;
break;
} location /status {
stub_status on;
access_log off;
} location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
} location ~ .*\.(js|css)?$
{
expires 12h;
} access_log /home/wwwlogs/XX/access.log access; }

  如此配置下就可以用了

CodeIgniter nginx 404的更多相关文章

  1. Debian中CodeIgniter+nginx+MariaDB+phpMyAdmin配置

    本文不讲述软件安装过程,记述本人在Debia中配置CodeIgniter时遇到的问题及解决方法,希望能够为有需要的人提供帮助. 一.Debian版本及所需的软件 Debian 9.8 stretch ...

  2. codeigniter nginx rewrite规则配置【转】

    转自:http://www.nginx.cn/1134.html nginx如何配置才能支持codeigniter ? 1. codeigniter的url美化去掉index.php   1 2 3 ...

  3. magento 1.9 nginx 404

    原来的nginx 配置 lnmp 环境默认的 location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fast ...

  4. nginx 404重定向到自定义页面

    在访问时遇到上面这样的404错误页面,我想99%(未经调查,估计数据)的用户会把页面关掉,用户就这样悄悄的流失了.如果此时能有一个漂亮的页面能够引导用户去他想去的地方必然可以留住用户.因此,每一个网站 ...

  5. linux nginx 404错误页面设置

    配置nginx 实现404错误 返回一个页面 1.配置nginx.conf 在http代码块 添加 fastcgi_intercept_errors on; 2.在网站的sever代码块 添加 err ...

  6. Nginx 404 500

    Nginx反向代理自定义404错误页面 http中添加 proxy_intercept_errors on; server中添加 error_page 404 = https://www.longda ...

  7. Nginx 404 Not Found 解决办法

    环境:宝塔Nginx面板 解决办法: 宝塔面板--站点设置-配置文件. 去掉:   error_page 404 /404.html; 前面的 # 号.

  8. codeigniter nginx配置

    转载:http://www.nginx.cn/1134.html server{ listen 80; server_name www.ci.oa.com; access_log /usr/local ...

  9. nginx 404 403等错误信息页面重定向到网站首页或其它事先指定的页面

    server { listen 80; server_name www.espressos.cn; location / { root html/www; index index.html index ...

随机推荐

  1. Attribute "resource" must be declared for element type "mapper".

    今天在玩mybatis的时候,遇到这个奇葩问题. 最后发现,原因是 dtd文件配置错误了.错把Mapper的直接copy过来 把DOCTYPE mapper改成configuration,Mapper ...

  2. MFC的BeginWaitCursor和EndWaitCursor函数

    MFC提供了BeginWaitCursor和EndWaitCursor函数来显示和隐藏等待的图标,以下是例子. void CMainView::OnEditClone() {     BeginWai ...

  3. iOS nib file owner

    nib文件中的file owner属性,设定后app在运行时加载nib文件的过程中会通过file owner重新建立nib文件中描述的控件与其在file owner中对应的IBOutlet或IBAct ...

  4. win7的svchost.exe占用内存过高如何解决

    方法/步骤 1 在我的电脑上点击鼠标右键,选择[管理] 步骤阅读 2 选择右侧[服务和应用程序]下的[服务]选项 步骤阅读 3 找到名称我Superfetch的服务,双击鼠标左键. 步骤阅读 4 选择 ...

  5. DataGridView控件“至少有一列没有单元格模板”问题处理

    这个问题一般是没有设置单元格模板造成的. mdgv.Columns[].CellTemplate = new DataGridViewTextBoxCell();

  6. Oracle题目

    1. 创建一个函数fun_sal,该函数根据部门号获得该部门下所有员工的平均工资Create or replace function fun_sal(deptnos number)return var ...

  7. protocol buffers的使用示例[z]

    [http://blog.csdn.net/zhu_xun/article/details/19397081] protocol buffers的使用示例 如果不了解protocol buffers, ...

  8. Z - Fighting 和 Depth-bias

    Depth-bias操作在clipping之后进行实施,所以depth-bias对几何clipping没有影响. 另外需要注意的是:对一个给定体元(primitive),bias值是一个常量,在进行差 ...

  9. iOS书摘之编写高质量iOS与OS X代码的52个有效方法

    来自<Effective Objective-C 2.0编写高质量iOS与OS X代码的52个有效方法>一书的摘要总结 一.熟悉Objective-C 了解Objective-C语言的起源 ...

  10. JAVA -Xms -Xmx -XX:PermSize -XX:MaxPermSize 区别

    java  -Xms -Xmx -XX:PermSize -XX:MaxPermSize     在做java开发时尤其是大型软件开发时经常会遇到内存溢出的问题,比如说OutOfMemoryError ...