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 ...
随机推荐
- jQuery MiniUI开发系列之:UI和数据分离
使用MiniUI需要注意:UI和数据是分离的. 传统的WEB开发,开发者经常将数据库操作.服务端业务.HTML标签写在一个页面内. 这样会造成开发的混乱,并且难以维护和升级. 使用MiniUI开发的时 ...
- 实例存储支持的AMI创建步骤
实例存储支持的AMI创建步骤 一.Windows AMI 1. 选择实例存储支持的AMI创建实例. 2. 远程登录实例进行定制化配置. 3. 通过Web控制台或命令行Bundle实例(并自动上传到S3 ...
- UNIX网络编程-非阻塞connect和非阻塞accept
1.非阻塞connect 在看了很多资料之后,我自己的理解是:在socket发起一次连接的时候,这个过程需要一段时间来将三次握手的过程走完,如果在网络状况不好或者是其他的一些情况下,这个过程需要比较长 ...
- AFNnetworking详解
AFN 一.什么是AFN 全称是AFNetworking,是对NSURLConnection的一层封装 虽然运行效率没有ASI高,但是使用比ASI简单 在iOS开发中,使用比较广泛 AFN的githu ...
- oracle基础语法大全
-----创建序列create sequence book_idINCREMENT BY 1 -- 每次加几个 START WITH 001 -- 从1开始计数 NOMAXVALUE -- 不设置最大 ...
- Spark Streaming源码解读之No Receivers彻底思考
本期内容 : Direct Acess Kafka Spark Streaming接收数据现在支持的两种方式: 01. Receiver的方式来接收数据,及输入数据的控制 02. No Receive ...
- 数据库——JDBC
数据库--JDBC 数据库优点:降低存储数据的冗余度: 更高的数据一致性: 存储的数据可以共享: 可以建立数据库所遵循的标准: 便于维护数据完整性: 能够实现数据的安全性: 建立数据库: 数据库的存储 ...
- What is SPI?
原文地址:http://www.fpga4fun.com/SPI1.html SPI is a simple interface that allows one chip to communicate ...
- go语言环境搭建+sublime text3(windows环境下)
感觉有点坑,整了一下午~搞定 go语言环境搭建+sublime text3(windows环境下) 1.安装sublime text3 2.安装go语言程序包 3.测试go语言是否安装成功 键 ...
- springmvc+mybatis整合
maven 依赖 <!-- springmvc --> <dependency> <groupId>org.springframework</groupId& ...