步骤:

下面我说下 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. 如何让我domain里的机器都跟domain controller的时间保持一致?

    貌似是应该先在PDC上设一个时间源服务器, 然后, 再让domain里所有的机器都去与PDC去sync时间即可. 可是笔者的环境里, 怎么都配不同, 我觉得可能是实验室的网络有什么特别的设置吧. 不管 ...

  2. 关于android SDK安装Failed to fetch URL 一点思考

    最近SDK出问题了,然后在google下载了一个android-sdk-windows.rar,然后点击SDK Manager,结果一直不能刷新API Level,然后就开始在网上找了好多资料,解决这 ...

  3. Linq-插入insert

    1.简单形式 说明:new一个对象,使用InsertOnSubmit方法将其加入到对应的集合中,使用SubmitChanges()提交到数据库. NorthwindDataContext db = n ...

  4. capwap学习笔记——初识capwap(一)

    2 初识CAPWAP 2.1 CAPWAP简介 说了半天CAPWAP,连全称都还没说,汗-- CAPWAP--Control And Provisioning of Wireless Access P ...

  5. OpenGL中的原子操作需要注意的地方

    OpenGL中的原子操作需要注意的地方 仔细阅读看画红线的部分

  6. [React] Asynchronously Load webpack Bundles through Code-splitting and React Suspense

    One approach to building high performance applications with webpack is to take advantage of code-spl ...

  7. [Algorithm] Reservoir Sampling

    Given a stream of elements too large to store in memory, pick a random element from the stream with ...

  8. iOS社交app技术合伙人笔试题

    理想状况当然是找到有管理能力且还在写代码的架构师了,然而假设有这种人,他自己能发起项目了.你要拉上他还真难.满足一定条件就可以了,别追求完美. 还有比这更完美的吗?请生产这种机器人: 性格开朗(开朗≠ ...

  9. Javascript 的模块化编程及加载模块【转载+整理】

    http://www.ruanyifeng.com/blog/2012/10/javascript_module.html 本文内容 引入 模块化 最初写法 对象写法 立即执行函数写法 放大模式 宽放 ...

  10. python 微信企业号

    python 微信企业号 准备,如果没有微信企业号,可以先申请体验号记下CorpID和Secret(获取Token用) 发送消息首先可以在微信的开发者中心,查看接口文档 下面就是python代码:1. ...