tp5 隐藏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,规则如下:
1、确认你的apache开启rewrite模块、
2、修改官方文件最后一行 (PHP5.5+)
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
如果你使用的apache版本使用上边的方式无法正常隐藏index.php 可以尝试使用下边的方式配置.htaccess文件:
1、确认你的apache开启rewrite模块、
2、修改官方文件最后一行,在/$1前边加一个 ? (注意英文格式半角)
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
如果是Nginx环境,可以在Nginx.conf中添加:
location / { //......省略部分代码
if(!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
1
tp5 隐藏index.php的更多相关文章
- tp5 隐藏index.php 邓士鹏
tp5 隐藏index.php ------------------------------------------------------------------------------------ ...
- TP5隐藏index.php
一,找到/public/.htaccess文件,如果你的入口文件已经移动到根目录下,那么你的.htaccess文件也要剪切到根目录下,总之要确保.htaccess跟入口的index.php保持同级. ...
- lnmp 一键安装包 nginx配置tp5 phpinfo模式 隐藏index.php
tp5 url 线上访问 在nginx 上 出现404错误 那是因为pathinfo没有被支持 修改如下:找到 /usr/local/nginx/config/vhost/项目名.config s ...
- tp5 thinkphp5 index.php隐藏 iis 重写 伪静态
面临的问题如下: 网上找了个源码,tp5的,公司服务器是iis,源码是隐藏index.php使用了路由,iis默认去找那个路径的文件了,找不到,所以报错了 如果没有iis没有安装"url重写 ...
- TP5框架 nginx服务器 配置域名 隐藏index.php
server { listen ; #server_name localhost; server_name hhy.com;/**这里写自己的域名*/ #charset koi8-r; #access ...
- ThinkPHP CI codeignitor 框架 apache 重写 url 隐藏index.php 服务器 报错:Object not found! 可能是.htaccess隐藏index.php
隐藏index.php可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则.以Apache为例,需要在入口文件的同级添加.htaccess文件(官方默认自带了该文 ...
- ThinkPHP5 隐藏index.php问题
隐藏index.php 可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则. 以Apache为例,需要在入口文件的同级添加.htaccess文件(官方默认自带了 ...
- nginx下TP5 隐藏入口文件+支持pathinfo模式+配置多项目根目录
首先说下项目目录情况 跟目录/usr/share/nginx/html/(别说怎么这么深 0.0) html文件夹下面两个目录 pssh pssh_shop 两个tp5项目分别对应两个二级域名 ...
- CI 框架隐藏index.php-ubuntu
和朋友在做一个小网站,用到了CI框架,之前测试都是在windows上,隐藏index.php也相对比较简单.但服务器是ubuntu系统,需要配置一下,根据网上看到的一些教程,结合自己电脑的特点,记录步 ...
随机推荐
- Activiti task claim concurrent
Activiti task claim cocurrent - 国内版 Binghttps://cn.bing.com/search?q=Activiti+task+claim+cocurrent&a ...
- Python3基础 yield send 变量名= yield i
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- Python - Django - form 组件基本用法
普通 form 表单的处理: reg.html: <!DOCTYPE html> <html lang="en"> <head> <met ...
- [LeetCode] 93. Restore IP Addresses 复原IP地址
Given a string containing only digits, restore it by returning all possible valid IP address combina ...
- 阿里云k8s构建镜像时设置版本号用于版本回滚
jenkins 构建配置参数化构建过程 构建 执行 shell , 将版本号参数传入 脚本 脚本push 带版本号的镜像到阿里云镜像仓库 #!/bin/bash #获取参数 while geto ...
- Spring boot后台搭建二集成Shiro权限控制
上一篇文章,实现了用户验证 查看,接下来实现下权限控制 权限控制,是管理资源访问的过程,用于对用户进行的操作授权,证明该用户是否允许进行当前操作,如访问某个链接,某个资源文件等 Apache Shir ...
- Rabbitmq消息积压清理
#!/bin/bash QUE=`rabbitmqctl list_queues messages_ready name durable|grep -v "^Listing" |g ...
- jquery鼠标经过弹出层写法
jquery鼠标经过弹出层写法<pre><div class="navitem"><a href="/index.php?c=news&am ...
- 切换 Python2 Python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 sudo update-alternati ...
- 1.jvm思维导图
点击图片可查看高清图