zoukankan      html  css  js  c++  java
  • CI路径中如何去掉index.php

    apache去掉index.php

    1.编辑conf/httpd.conf配置文件

      #LoadModule rewrite_module modules/mod_rewrite.so 把该行前的#去掉

      同时对应Directory下要配置 AllowOverride All

    2.在 CI 根目录下(即在index.php,system的同级目录下)新建立一个配置文件,命名为: .htaccess 内容如下:

      RewriteEngine On

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteCond %{REQUEST_FILENAME} !-d

      RewriteCond $1 !^(index.php|robots.txt)

      RewriteRule ^(.*)$ index.php/$1

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteRule ^(application|modules|plugins|system|themes) index.php/$1 [L]

    3.把system/application/config/config.php 中$config['index_page'] = "index.php";改为$config['index_page'] = ""; 

    4.重启apache

    nginx去掉index.php

    1.编辑nginx.conf文件

      vi /usr/local/xxxxx/nginx/conf/nginx.conf

      #nginx去掉index.php

          location / {

             rewrite ^/$ /index.php last;

             #防止某些文件夹被直接访问

             rewrite ^/(?!index.php|robots.txt|uploadedImages|resource|images|js|css|styles|static)(.*)$ /index.php/$1 last;

          }

    2.config/config.php下配置$config['index_page'] = '';

    3..重启nginx

  • 相关阅读:
    webview 缓存
    winform 托盘
    winform自动保存属性变更
    序列化条件
    System.Web.HttpUtility VS System.Net.WebUtility
    javascript模拟sleep
    C#实现把科学计数法(E)转化为正常数字值 (转)
    appium远程连手机调控
    adb通过wifi连接android设备
    在项目中接口测试时怎么做的?
  • 原文地址:https://www.cnblogs.com/antik/p/3990677.html
Copyright © 2011-2022 走看看