WDCP配置ThinkPHP5伪静态隐藏index.php,出现“”解决重定向次数过”问题
站点域名的配置:xxx.com.conf
server {
listen 80;
root /www/web/xxx_com/public_html;
server_name xxx.com;
index index.html index.php index.htm;
error_page 400 /errpage/400.html;
error_page 403 /errpage/403.html;
error_page 404 /errpage/404.html;
error_page 503 /errpage/503.html;
location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp/php-70-cgi.sock;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
#fastcgi_param PATH_INFO $2;
include fcgi.conf;
#下面追加的
set $real_script_name $fastcgi_script_name;
set $path_info "";
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location ~ /\.ht {
deny all;
}
location / {
#伪静态重写的
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
try_files $uri $uri/ /?$args;
}
}
WDCP配置ThinkPHP5伪静态隐藏index.php,出现“”解决重定向次数过”问题的更多相关文章
- tp5,thinkphp5,隐藏index.php,隐藏入口文件
一.找到/public/.htaccess文件 Apache: <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews R ...
- IIS7下配置web.config隐藏index.php
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.we ...
- nginx 隐藏 index.php 和 开启 pathinfo 模式的配置
nginx 通过 location 的规则匹配将 php 转发给 php-fpm 处理后获取结果然后返回给客户端,转发模式可以通过 unix sock 或 tcp socket 方式.百度了好多文章我 ...
- lnmp1.4 nginx配置thinkphp5
vhost/xxx.conf配置图,重点是红色框框 研究了两三天 ,至此thinkphp5 路由,隐藏index.php全部解决 感谢网友的分享:http://blog.csdn.net/gaoxiu ...
- Nginx隐藏index.php和配置vhost
nginx启动命令 启动:nginx停止:nginx -s stop退出:nginx -s quit重启:nginx -s reopen重新加载:nginx -s reload平滑启动:kill -H ...
- ThinkPHP5 隐藏index.php问题
隐藏index.php 可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则. 以Apache为例,需要在入口文件的同级添加.htaccess文件(官方默认自带了 ...
- [转]ThinkPHP5 隐藏index.php问题
ThinkPHP5 隐藏index.php问题 Apache,修改.htaccess文件 ----------------------------------------------------- R ...
- nginx配置隐藏index.php
Nginx 服务器隐藏 index.php 配置 location / { try_files $uri $uri/ /index.php?$query_string; } nginx配置中t ...
- Yii2.0简单隐藏index.php文件和模块配置和layout布局配置禁用和日志写入配置
隐藏index.php文件 目的:想去掉浏览器地址栏中的 index.php?r= 这一块. 在/config/web.php中 ’components'=>[] 中添加如下代码: 'u ...
随机推荐
- PART(Persistent Adaptive Radix Tree)的Java实现源码剖析
论文地址 Adaptive Radix Tree: https://db.in.tum.de/~leis/papers/ART.pdf Persistent Adaptive Radix Tree: ...
- 11.1 Go Http
11.0 Go Http http客户端 package main import ( "fmt" "net/http" "net/http/httpu ...
- 4.4 Go goto continue break
4.4 Go goto continue break Go语言的goto语句可以无条件的跳转到指定的代码行执行. goto语句一般与条件语句结合,实现条件转义,跳出循环体等. Go程序不推荐使用got ...
- Hyperledger Fabric——balance transfer(二)注册用户
详细分析blance transfer示例的用户注册(register)与登录(enroll)功能. 源码分析 1.首先分析项目根目录的app.js文件中关于用户注册和登录的路由函数.注意这里的tok ...
- poj2112 网络流+二分答案
Optimal Milking Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 18083 Accepted: 6460 ...
- 【python爬虫】scrapy入门2--自定义item
items.py class LianhezaobaospyderItem(scrapy.Item): # define the fields for your item here like: # n ...
- centos 删除文件提示 Operation not permitted
如果文件上存在 i 标记,那肯定是删不掉的,同样这个文件也不能被编辑.可以进入 root 模式,去除这个标记: root@ubuntu:/home/barret/work# chattr -i 1.m ...
- java三个时间类常用法
1.System.currentTimeMillis(); 获取当前时间戳 System的获取时间戳的方法,只能获取不能进行其他的操作,简单的毫秒计算可以使用 2.Date(),Date( ...
- [CSharp]传一个包含多个属性的对象,只改变其中个别属性值的方法
需求 假如有这么一个需求,一个对象Person内的属性设置外包给了另外一个类Options, 而要设这个Person对象的属性,就必须传一个Options实例, 但又不能每个属性重新设一遍,只设要修改 ...
- Android调试非常有用的命令集1_adb&aapt&git&repo&scp&while
Linux部分场景非常有用的命令集_1_持续更新 这里面也包含了对于开发调试有用的命令,也可以看看. 这里不做详细说明或截图,仅作为记录和简单说明.注:可能只针对某一命令部分功能,不包含整个功能,若要 ...