以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. 自己定义带三角形箭头的TextView

    <?xml version="1.0" encoding="utf-8"? > <resources>      <declare ...

  2. Linq-System.Data.Linq.DataContext不包含采用“0”个参数的构造函数

    解决方法: 打开linq to sql 的db文件***.designer.cs,加上下面的代码: 加上这些构造函数之后重新生成就可以了.

  3. 通过page页面与portlet的结合实现报表的局部刷新

    场景:系统已经存在两个报表,报表A与B,A与B之间可以通过省份进行追溯. 如下图:点击 报表[销售数据按区域]中的北京市 追溯到报表[销售数据按省份] 需求:让上面的操作在一个page里面刷新,实现页 ...

  4. Angular CLI的安装及使用

    安装命令行 npm install -g @angular/cli 检查命令行 ng v 使用这个命令可以检查 angular cli是否安装成功.我检查的时候发现没有安装成功,提示我使用的node. ...

  5. solr安装使用笔记

    下载 solr官方下载地址:http://lucene.apache.org/solr/ 使用 启动 solr dir/bin/solr.cmd start 停止 solr dir/bin/solr. ...

  6. 使用Iperf工具测试android系统网络wifi的吞吐量wifithrougput

    http://blog.csdn.net/bingxuebage/article/details/7534655 服务端:./iperf3 -s &客户端:./iperf3 -c 10.15. ...

  7. POSIX 线程 – pthread_sigmask

    http://www.cnblogs.com/qq78292959/archive/2012/04/05/2432985.html 概念 按照 POSIX, 异步 (外部) 信号发送到整个进程. 所有 ...

  8. Android Gson解析json详解

    目前解析json有三种工具:org.json(Java常用的解析),fastjson(阿里巴巴工程师开发的),Gson(Google官网出的),解析速度最快的是Gson,下载地址:https://co ...

  9. Java程序猿学习C++之数组和动态数组

    数组: #include <iostream> using namespace std; //模板函数 template <class T> void dump(T val) ...

  10. 解决Eclipse里项目名有红叉,但是底下的每一个文件都没有红叉

    有这种错误让人很恼火,因为并不知道是哪个文件引起的整个项目错误.所以我们可以打开下边的错误按钮,看看是什么问题. 1.如果是因为java compiler level does not match t ...