nginx支持pathinfo并且隐藏index.php
How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/
就像这样
The URL before setting like this:
http://serverName/index.php?m=Home&c=Customer&a=getInformation&id=1
Now like this:
http://serverName/Home/Customer/getInformation/id/1
这是偶的配置:
server {
listen 80;
server_name mybuy.com;
root /Users/he/Projects/maibei-backend;
#charset koi8-r;
access_log /Users/he/weblog/mybuy.com.access.log;
error_log /Users/he/weblog/mybuy.com.error.log;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
index index.php index.html index.htm;
}
# pass the PHP scripts to FastCGI
server listening on 192.168.1.123:9000
#
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
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;
}
}
nginx支持pathinfo并且隐藏index.php的更多相关文章
- codeigniter在nginx 下支持pathinfo和去除index.php的方法
as今天准备把网站搬迁到nginx上发现codeigniter框架在nginx上不能使用,后来发现是nginx不支持pathinfo,下面介绍怎么在nginx下开启pathinfo 开始pathinf ...
- 配置Nginx支持pathinfo模式
Nginx服务器默认不支持pathinfo, 在需要pathinfo支持的程序中(如thinkphp),则无法支持”/index.php/Home/Index/index”这种网址.网上流传的解决办法 ...
- nginx支持pathinfo模式
很久不使用apache了,渐渐对apache感到陌生,因为朋友有个ZendFramework框架从apache移到nginx下,需要pathinfo模式支持.网上海搜于是开始搜索nginx+pathi ...
- 使得nginx支持pathinfo访问模式
原理: 任意创建一个 in.php 文件: <?php echo '<pre>'; ...
- 使nginx支持pathinfo模式
在将fastadmin部署到虚拟机中时,遇到如下问题:当访问登录页面时,页面进行不断的循环跳转重定向.解决方法是将nginx配置为支持pathinfo的模式 以下是nginx中的配置内容: locat ...
- TP5框架 nginx服务器 配置域名 隐藏index.php
server { listen ; #server_name localhost; server_name hhy.com;/**这里写自己的域名*/ #charset koi8-r; #access ...
- centOS7.4 thinkPHP nginx 支持pathinfo和rewrite
server { listen 80; server_name www.demo.com mayifanx.com; root /data/www/demo; index index.php inde ...
- 让Nginx支持pathinfo
# 典型配置 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_ ...
- Nginx 虚拟主机下支持Pathinfo并隐藏入口文件的完整配置
server { listen 80; server_name zuqiu.com; # 设置你的域名 index index.html index.htm index.php; root D:/wn ...
随机推荐
- 前端模板之EasyUI常用控件及参数
CSS类定义 div easyui-window window窗口样式 属性如下: 1) modal:是否生成模态窗口.true[是] false[否] 2) shadow:是否显示窗口阴影.true ...
- 第一周:Java基础知识总结(1)
1.软件开发的基本步骤: 1.分析问题,建立数据模型. 2.确定数据结构类型和算法. 3.编写程序. 4.调试程序. 2.Java语言 Java是一种简单的.面向对象的.分布式的.解释的.安全的.可移 ...
- 我的 Kernel
求真 工作之后,渐渐与人打交道,人情世俗也慢慢接触了,领了工资之后,也可以买一些自己喜欢的东西,感觉也开始像一个独立完整的人了. 所见所闻也有所想了,有些理念开始慢慢转变了.但是,不知道为什么,对于假 ...
- (整理)C#基础知识_泛型的实现
本文是截取自MSDN的文章部分,方便自己查看,原文地址:https://msdn.microsoft.com/zh-cn/library/ms379564(VS.80).aspx 泛型实现 表面上,C ...
- [python实现设计模式]-3.简单工厂模式-触宝开放平台
预备知识: 开放封闭原则(Open-Closed Principle OCP) Software entities(classes,modules,functions etc) should open ...
- VC++动态链接库(DLL)编程深入浅出(zz)
VC++动态链接库(DLL)编程深入浅出(zz) 1.概论 先来阐述一下DLL(Dynamic Linkable Library)的概念,你可以简单的把DLL看成一种仓库,它提供给你一些可以直接拿来用 ...
- Silverlight 页面传值问题(转)
共有两种方式来传递初始化参数 1)在html或者aspx页面中object对象中加入一下代码 参数格式:参数名 = 值,参数名 = 值,... <param name="initPar ...
- VI 命令 gg 跳到第一行,dG 删除后面的所有内容
VI 命令 gg 跳到第一行,dG 删除后面的所有内容
- js正则表达式(常用)
正则表达式(常用) 写法 js写法 var re = new RegExp("a","i"); perl写法 var re = /a/ ; 量词 {n} 正好出 ...
- 图片转base64
function convertImgToBase64(url, callback, outputFormat){ var canvas = document.createElement('CANVA ...