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 ...
随机推荐
- Dictionary的几种遍历方法
Dictionary<string, int> list = new Dictionary<string, int>(); list.Add("d", 1) ...
- 网页WEB打印控件制作-开放源码
在WEB系统中,打印的确是比较烦人的问题,如果我们能制作一个属于自己的自定义的打印插件,那么我们在后续自定义打印的时候能随心所欲的控制打印,这样的效果对于程序员来说是非常开心的一件事件,本文将自己开发 ...
- UIViewContentMode各类型效果
UIViewContentMode typedef enum { UIViewContentModeScaleToFill, UIViewContentModeScaleAspectF ...
- Android UI 绘制过程浅析(五)自定义View
前言 这已经是Android UI 绘制过程浅析系列文章的第五篇了,不出意外的话也是最后一篇.再次声明一下,这一系列文章,是我在拜读了csdn大牛郭霖的博客文章<带你一步步深入了解View> ...
- openlayers中实现自定冒泡的效果
自定义的Openlayers.Popup.FreshCloud继承自Openlayers.Popup.Framed,实现了比较简洁的冒泡效果,详细代码如下 /** * Class: OpenLayer ...
- http://paulgraham.com/arcfaq.html
Why not use some other delimiter than parentheses?为什么不使用一些其他的分隔符比括号?We tried various possibilities. ...
- php使用saop简单例子和注意事项
首先配置下PHP的soap环境支持: 找到php.ini文件:extension=php_soap.dll :always_populate_raw_post_data = -1 删除掉": ...
- js错误:TypeError $(...) is null
转载自:http://www.phpernote.com/jquery/851.html:
- 一个解决adb5037端口被绑定问题的小程序-以管理员身份运行
@echo start adb... @rem 获取绑定的进程id输出到一个临时文件 @call netstat -ano |findstr " |findstr "LISTENI ...
- 格式化namenode,造成无法启动datanode
一个常见的问题:格式化namenode,造成无法启动datanode的问题. 问题描述: 无法启动datanode,查看日志,datanote尝试n次启动无效后,会出现这个语句 INFO ...