一:

官方文件:

  1. <IfModule mod_rewrite.c>
  2. Options +FollowSymlinks -Multiviews
  3. RewriteEngine on
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
  7. </IfModule>

修改后的文件  :

  1. <pre code_snippet_id="2463884" snippet_file_name="blog_20170629_4_2585774" name="code" class="plain"><IfModule mod_rewrite.c>
  2. Options +FollowSymlinks -Multiviews
  3. RewriteEngine On
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
  7. 改了最后一句:RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

二:

RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

或者

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

tp5无法隐藏index.php入口文件的更多相关文章

  1. thinkphp5.0如何隐藏index.php入口文件

    隐藏入口文件 public/index.php 同级的.htaccess文件 [ Apache ] 方法1: <IfModule mod_rewrite.c> Options +Follo ...

  2. nginx服务器绑定多个域名、支持pathinfo路由、隐藏index.php入口文件

    这篇文章仅仅是操作,解释说明部分待更新. 1. 修改nginx的配置文件(我的配置文件在/etc/nginx/nginx.conf) [root@xxx ~]# find / -name nginx. ...

  3. CI 框架 隐藏index.php 入口文件 和 设置访问application下子目录

    1.隐藏根目录下 index.php, 在根目录下创建 .htaccess文件 内容如下: <IfModule mod_rewrite.c> RewriteEngine on Rewrit ...

  4. index.php入口文件至根目录

      登录|注册       咖啡如同生活的专栏 从不羡慕别人的优秀,因为相信自己也可以优秀. 闲下来时看看书,书本里的故事,总有你学到的人生.       目录视图 摘要视图 订阅 异步赠书:9月重磅 ...

  5. ThinkPHP中通过URL重写隐藏应用的入口文件index.php的相关服务器的配置

    [ Apache ] 将httpd.conf配置文件中mod_rewrite.so所在行前面的‘#’去掉 AllowOverride None 将None改为 All 效果图

  6. thinkphp 5.0 在appache下隐藏index.php入口代码

    一.在appache的配置文件httpd.conf中开启rewrite_module 二.启用.htaccess的配置 启用.htaccess,需要修改httpd.conf,启用AllowOverri ...

  7. Ubuntu Server 14.04 & Apache2.4 虚拟主机、模块重写、隐藏入口文件配置

    环境: Ubuntu Server 14.04 , Apache2.4 一.Apache2.4 虚拟主机配置 01. 新建一份配置文件 在apache2.4中,虚拟主机的目录是通过/etc/apach ...

  8. Yii Framework隐藏index.php文件的步骤

    Yii Framework隐藏index.php文件的步骤 作者:feebas 发布于:2012-4-23 13:36 Monday 分类:Yii Framework 1.开启apache的mod_r ...

  9. url优化|隐藏index.php

    隐藏index.php   一.codeigniter codeigniter和许多php框架一样,有个单一入口index.php,从url上看,显得很不友好.通过apache的rewirte,是可以 ...

随机推荐

  1. OpenCV探索之路(二):图像处理的基础知识点串烧

    opencv图像初始化操作 #include<opencv2\opencv.hpp> #include<opencv2\highgui\highgui.hpp> using n ...

  2. ActiveMQ进阶学习

    本文主要讲述ActiveMQ与spring整合的方案.介绍知识点包括spring,jms,activemq基于配置文件模式管理消息,消息监听器类型,消息转换类介绍,spring对JMS事物管理. 1. ...

  3. 常用Atom插件列表

    1.simplified-chinese-menu Atom的简体中文语言包,完整汉化,兼容所有已发布的版本Atom. 2.tree-view-finder 左边菜单栏显示方式,类似Mac OS下的f ...

  4. HtmlWebpackPlugin实现资源的自定义插入

    目前碰到的问题 我们用html-webpack-plugin的inject属性去自动插入打包后的js, css到页面中,但是如果想给script标签添加一个crossorigin属性呢, 例如: &l ...

  5. 纯CSS3模拟星体旋转效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. springmvc json数据返回前台,中文乱码

    @ResponseBody@RequestMapping(value = "selectProvinces",produces = "text/json;charset= ...

  7. ORM: object relationship mapping

    ORM: object relationship mapping 关于数据库的两条命令: python manage.py makemigrations python manage.py migrat ...

  8. js分享功能

    引用JiaThis的分享功能: 直接在想要放置分享功能的地方加上如下代码即可: <!-- JiaThis Button BEGIN --> <div class="jiat ...

  9. Codeforces 768A Oath of the Night's Watch

    A. Oath of the Night's Watch time limit per test:2 seconds memory limit per test:256 megabytes input ...

  10. 状压dp初探

    写了几道状压...然后就一直在颓废... 2064: 分裂 http://www.lydsy.com/JudgeOnline/problem.php?id=2064 初始的为正,最后的为负,假设我们能 ...