当前位置:网站首页>关于tp的apache 的.htaccess文件
关于tp的apache 的.htaccess文件
2022-08-02 03:24:00 【auspi12341】
为了在url中隐藏index.php,需要写 RewriteRule
查看phpinfo() 打印的Server API: Apache 2.0 Handler
查看phpinfo() 打印的Server API: CGI/FastCGI
==================================================================
默认的:
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
==================================================================
如果为 Server API: CGI/FastCGI 需要修改为:
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
==================================================================
如果 Apache 的配置文件中使用 Alias 映射访问目录
Alias /sports "D:/WorkSpace/Sports/public/"
需要加上 Rewritebase /sports
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
Rewritebase /sports
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
边栏推荐
- ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
- 函数提升和变量提升
- Phospholipid-polyethylene glycol-azide, DSPE-PEG-Azide, DSPE-PEG-N3, MW: 5000
- 微信小程序云开发之模糊搜索
- ES6介绍+定义变量+不同情况下箭头函数的this指向
- 微信小程序云开发-证件照的实现
- 微信小程序云开发如何将页面生成为pdf?
- URL模块
- [Learning Records of Boxue Valley] Super summary, share with heart | Software Testing Interface Testing Basics
- C语言中关于2的n次方求值问题(移位运算)
猜你喜欢
Error in render: “TypeError: Cannot read properties of null (reading ‘0‘)“ 报错解决方案
正则笔记(2)- 正则表达式位置匹配攻略
querystring模块
线程池(线程池介绍与使用)
阿里云服务器如何使用admin账户登录
The querystring module
点名系统和数组元素为对象的排序求最大值和最小值
js 原型和原型链
require模块化语法
【 application 】 life many years of operations, what turned scored 12 k + annual bonus salary?
随机推荐
钟表刻度线
ES6迭代器解释举例
5.20今日学习
我的小笔记 =》其他东东
数组的高级操作
你的本地创建的项目库还在手动创建远端代码仓库再推送吗,该用它了
js takes the value of a feature at a certain position in the string, such as Huawei=> Huawei
L1-043 阅览室 (20分)
Amazon sellers how to improve the conversion
SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
URL URL
[Learning Records of Boxue Valley] Super summary, share with heart | Software Testing Interface Testing Basics
骨架效果 之高级渐变,适用图片等待时
每日五道面试题总结 22/7/26
解决5+APP真机测试无法访问后台(同局域网)
第一次手撕代码,如何解出全排列问题
Living to detect the Adaptive Normalized Representation Learning for GeneralizableFace Anti - Spoofing reading notes
IO流、 编码表、 字符流、 字符缓冲流
js 正则中 replace() 使用
阿里云服务器如何使用admin账户登录