以Apache为例,需要在index.php入口文件的同级添加.htaccess文件,内容如下:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
如果用的 phpstudy,规则如下:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

Apache 隐藏 index.php,如将 tp5.com/index.php/hello/123 变成 tp5.com/hello/123的更多相关文章

  1. 【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)

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

  2. apache 隐藏 index.php

    在根目录下添加文件 .htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteC ...

  3. Apache 隐藏入口文件以及防盗链.htaccess 文件

    Apache 隐藏入口文件以及防盗链.htaccess 文件 RewriteEngine on # 隐藏入口文件 RewriteCond %{REQUEST_FILENAME} !-d Rewrite ...

  4. 在APACHE服务器上的访问方式上去除index.php

      在APACHE服务器上的访问方式上去除index.php   下面我说下 apache 下 ,如何 去掉URL 里面的 index.php 例如: 你原来的路径是: localhost/index ...

  5. ORA-01502: index 'INDEX_NAME' or partition of such index is in unusable state

    ORA-01502: index 'INDEX_NAME' or partition of such index is in unusable state 原因: 这个错误一般是因为索引状态为UNUS ...

  6. ORA-01502: index ‘index_name' or partition of such index is in unusable state

    错误现象: 今天发布脚本时,一个表插入数据时报如下错误 ORA-01502: index ‘index_name' or partition of such index is in unusable ...

  7. 【vue】index.html main.js app.vue index.js怎么结合的? 怎么打包的?搜集的信息

    转载:https://blog.csdn.net/yudiandemingzi/article/details/80247137 怎么结合的: 一.启动项目 第一步:cmd进入项目文件里,运行npm ...

  8. DOM方法index()相关问题(为何$(this).index(this)是错误的 )

    写jQuery的时候遇到一个关于index()的问题,查找相关资料后,解决了,把自己的想法写在下面. index() 方法返回指定元素相对于其他指定元素的 index 位置. 完全语法为:$(sele ...

  9. SQL Server中的聚集索引(clustered index) 和 非聚集索引 (non-clustered index)

    本文转载自  http://blog.csdn.net/ak913/article/details/8026743 面试时经常问到的问题: 1. 什么是聚合索引(clustered index) / ...

随机推荐

  1. rsync同步数据---把左边的文件全部拷贝到右边

    背景,配置好了ssh 使用rsa pulbic key的方式登陆远程服务器.//ssh-keygen -t rsa -b 2048 -f andy-rsync-key -P '' https://he ...

  2. 廖雪峰的python学习网址

    http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00140737570055886 ...

  3. Untracked Files Prevent Checkout move or commit them before checkout

    点开View Files... 查看里面的文件名称,在项目的.idea文件夹中删掉ViewFiles显示的文件夹名称就好

  4. redis 超时失效key 的监听触发

    1. 事件通过 Redis 的订阅与发布功能(pub/sub)来进行分发,故需要订 阅 __keyevent@0__:expired 通道 0表示db0 根据自己的dbindex选择合适的数字 2.  ...

  5. Web Service 的工作原理(转载)

    Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量级的 ...

  6. Jquery Types 小结

    JavaScript provides several built-in(内置的) datatypes. In addition to those, this page documents virtu ...

  7. 关于zookeeper的自我解惑

    分布式服务框架 Zookeeper -- 管理分布式环境中的数据: http://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/  ...

  8. 关于DES加密中的 DESede/CBC/PKCS5Padding

    今天看到一段3DES加密算法的代码,用的参数是DESede/CBC/PKCS5Padding,感觉比较陌生,于是学习了一下. 遇到的java代码如下: Cipher cipher=Cipher.get ...

  9. 〖Linux〗OK6410a蜂鸣器的驱动程序编写全程实录

    最近在看一本书,受益匪浅,作者是李宁,下边是编写本次蜂鸣器的全程实录: 1. 了解开发板中的蜂鸣器 1) 查看蜂鸣器buzzer在底板中的管脚信息 2) 查看蜂鸣器在总线中的信息 3) 翻看S3C64 ...

  10. 转:基于 linux 平台的 libpcap 源代码分析

    libpcap 是 unix/linux 平台下的网络数据包捕获函数包,大多数网络监控软件都以它为基础.Libpcap 可以在绝大多数类 unix 平台下工作,本文分析了 libpcap 在 linu ...