1.apache要开启pathinfo模式,需要在

<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
#AcceptPathInfo on   #增加这行配置
Require all granted
</Directory>

2.nginx增加pathinfo模式配置:

server {
listen 80;
server_name localhost;
root /data/app;
index index.htm index.html index.php default.php default.html;

#增加下面配置项

location / {

  if (!-e $request_filename){
    rewrite ^/(.*) /index.php last;
  }
  }

###########

location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
}
}

关于url的pathinfo模式,要比普通的格式如http://localhost/index.php?a=2&b=3优雅,格式如:http://localhost/index.php/a/2/b/3

关于开启url的pathinfo模式的更多相关文章

  1. 用js拼接url为pathinfo模式

    用js拼接url为pathinfo模式

  2. [PHP] url的pathinfo模式加载不同控制器的实现

    使用自动加载和解析url的参数,实现调用到不同的控制器,实现了pathinfo模式和普通的url模式 文件结构: |--Controller |--Index |--Index.php |--Appl ...

  3. Nginx下配置ThinkPHP的URL Rewrite模式和pathinfo模式支持

    前面有关于lnmp环境的搭建,在此就不在赘述.下面就简述thinkPHP如何在nginx下开启url_rewrite和pathinfo模式支持 主要有两个步骤: 一.更改php.ini将;cgi.fi ...

  4. nginx完美支持thinkphp3.2.2(需配置URL_MODEL=>1 pathinfo模式)

    来源:http://www.thinkphp.cn/topic/26657.html 第一步:配置SERVER块 server { listen 80; server_name www.domain. ...

  5. ThinkPHP中pathinfo模式与URL重写

    Thinkphp中的pathinfo模式 http://serverName/appName/module/action/id/1/ pathinfo模式 在不考虑路由的情况下,第一个参数会被解析成模 ...

  6. ThinkPHP中的pathinfo模式和URL重写

    语文一直不太好,要我怎么解释这个pathinfo模式还真不知道怎么说,那就先来一段代码说下pathinfo模式吧 http://serverName/appName/module/action/id/ ...

  7. nginx 下开启pathinfo模式

    前几天自己新弄了个服务器,nginx的环境, 看到thinkcmf的框架,下载下来准备研究下,安装完成后,发现 url 是 普通模式,然后我就按照那个手册去后台开启了pathinfo模式,这一改完蛋了 ...

  8. nginx下开启pathinfo模式

    第一种方式是通过重写url来实现pathinfo模式: location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?s=/$ ...

  9. nginx 隐藏 index.php 和 开启 pathinfo 模式的配置

    nginx 通过 location 的规则匹配将 php 转发给 php-fpm 处理后获取结果然后返回给客户端,转发模式可以通过 unix sock 或 tcp socket 方式.百度了好多文章我 ...

随机推荐

  1. js导航栏样式变换

    <script type="text/javascript"> $(function(){ var lis = $(".submenu").chil ...

  2. C#调用winhttp组件 POST登录迅雷

    下面是封装好的winhttp类 using System; using System.Collections.Generic; using System.Linq; using System.Text ...

  3. android 控件自定义样式

    一.按钮(Button) 方式1.存在.9图片或图片时   可在drawable文件夹下新建xml文件style_button_one.xml,代码如下 <?xml version=" ...

  4. Objective-C Runtime 运行时之六:拾遗(转载)

    前面几篇基本介绍了runtime中的大部分功能,包括对类与对象.成员变量与属性.方法与消息.分类与协议的处理.runtime大部分的功能都是围绕这几点来实现的. 本章的内容并不算重点,主要针对前文中对 ...

  5. jmeter java性能测试

    本篇文章主要讲解jmeter如何测试java请求,以项目中某个接口为例,请求数据为post,返回也为post 1:新建maven工程,pom文件为 <project xmlns="ht ...

  6. Python学习笔记——基础篇【第五周】——os模块和sys模块

    OS模块 提供对操作系统进行调用的接口 os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录 ...

  7. Asp.Net BulletedList使用及详解

    BulletedList使用及详解   文章来源:www.cnblogs.com/xiohao/archive/2013/10/09/3359263.html BulletedList是一个让你轻松在 ...

  8. @classmethod及@staticmethod方法浅析【python】

    目前对于python中@classmethod 类方法和@staticmethod静态方法的有了一定的认识,之后有进一步的认识后继续记录. @classmethod :是和一个class类相关的方法, ...

  9. sharepoint 2013基于AD的Form表单登录(三)——选择用户时,屏蔽掉AD。

    //来源:http://www.cnblogs.com/lrforever/p/3695820.html 隐藏AD人员选择,$ad.IsVisible设置为true,则显示出AD里用户 $cpm = ...

  10. jquery获取radio的值

    Html代码是 <label><input type="radio" name="proofing" value="1"& ...