步骤:

下面我说下 apache 下 ,如何 去掉URL 里面的 index.php 
例如: 你原来的路径是: localhost/index.php/Index/index
改变后的路径是: localhost/Index/index

1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置 
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2.在APACHE里面去配置 ,将里面的AllowOverride None都改为AllowOverride All

注意:修改之后一定要重启apache服务。

3.确保URL_MODEL设置为2, (url重写模式)

在项目的配置文件里写

return Array( 
‘URL_MODEL’ => ’2′, 
); 
4 新建文件名为 .htaccess 的文件,放于根目录下,内容如下:

方法一:在RewriteRule后面的index.php之后加?(建议)

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>

或者方法二:(不建议)

在php.ini中找到

;cgi.force_redirect = 1

去掉前面的分号并且把后面的1改为0

【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)的更多相关文章

  1. CI 框架怎么去掉隐藏入口文件 index.php

    当我重新接触一个框架的时候首先肯定要去掉入口文件,也就是index.php 这个东西在url上很不漂亮,而且每次我访问我的网站的时候都要打进去url里面.这样告诉一个去掉 CI框架里面入口文件的方法, ...

  2. ThinkPHP5.X PHP5.6.27-nts + Apache 通过 URL 重写来隐藏入口文件 index.php

    我们先来看看官方手册给出关于「URL 重写」的参考: 可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考: 1.http.conf 配置文件加载 mod_rewr ...

  3. Apache 隐藏入口文件 index.php

    新建 .htaccess文件至站点目录下,并写入如下代码: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQ ...

  4. apache隐藏入口文件index.php

    LoadModule rewrite_module modules/mod_rewrite.so

  5. CI隐藏入口文件index.php

    1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同) 2.在CI的 ...

  6. nginx隐藏入口文件index.php

    网站的访问url可能是这样http://www.xxx.com/index.php/home/index/index 这种有点不美观,我们想达到如下效果http://www.xxx.com/home/ ...

  7. TP5 隐藏入口文件 index.php

    找到public下的.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine ...

  8. niginx隐藏入口文件index.php

    location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$ last; break; } }

  9. Nginx配置 隐藏入口文件index.php

    Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...

随机推荐

  1. 接收连接basic_socket_acceptor

    概述 TCP有一处和UDP不同的地方是TCP是面向连接的,TCP有建立连接.通信.关闭连接的操作,Boost.Asio提供了ip::tcp::acceptor用来接收新的TCP连接,底层由socket ...

  2. 阿里NLP总监分享-NLP技术的应用与思考

    https://yq.aliyun.com/articles/78031 NLP技术的应用及思考

  3. hdu4753 Fishhead’s Little Game 状态压缩,总和一定的博弈

    此题和UVA 10891 Game of Sum 总和一定的博弈,区间dp是一个道理,就是预处理麻烦 这是南京网络赛的一题,一直没做,今天做了,虽然时间有点长,但是1ac,这几乎是南京现场赛的最后一道 ...

  4. go语言之进阶篇接口的定义和实现以及接口的继承

    1.接口的定义和实现以及接口的继承 示例: package main import "fmt" //定义接口类型 type Humaner interface { //方法,只有声 ...

  5. Round() 四舍五入 js银行家算法

    首先问一下round(0.825,2) 返回的结果,大家猜一猜, 首先SQL server 返回的是 0.83 js的返回结果 是0.83,code 如下: var b = 0.825;        ...

  6. 在Linux中查看正在运行哪些process,杀掉一批名字相同的process

    列出全部进程: ps -A 杀掉所有名为netmist的进程 killall netmist 参考资料 ============ https://www.howtogeek.com/107217/ho ...

  7. ztree默认自动打开第一级

    var treeObj = $.fn.zTree.getZTreeObj("tree"); var nodes = treeObj.getNodes(); if (nodes.le ...

  8. Spring Boot集成MyBatis开发Web项目

    1.Maven构建Spring Boot 创建Maven Web工程,引入spring-boot-starter-parent依赖 <project xmlns="http://mav ...

  9. 【Spark】Spark Streaming 动态更新filter关注的内容

    Spark Streaming 动态更新filter关注的内容 spark streaming new thread on driver_百度搜索 (1 封私信)Spark Streaming 动态更 ...

  10. python实现itemCF and userCF

    http://my.oschina.net/zhangjiawen/blog/185625 1基于用户的协同过滤算法: 基于用户的协同过滤算法是推荐系统中最古老的的算法,可以说是这个算法的诞生标志了推 ...