public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", ...
分类:
Web程序 时间:
2015-11-24 14:53:14
阅读次数:
167
默认的lnmp没有开启pathinfo模式,但很多框架需要用到。cd /usr/local/nginx/confvim enable-php.conflocation ~ [^/]\.php(/|$){ # comment try_files $uri =404; to enable pathin....
分类:
其他好文 时间:
2015-11-22 20:21:00
阅读次数:
167
nginx模式默认是不支持pathinfo模式的,类似index.php/index形式的url会被提示找不到页面。下面的通过正则找出实际文件路径和pathinfo部分的方法,让nginx支持pathinfo。 server { listen 8080; se...
分类:
Web程序 时间:
2015-11-18 15:36:20
阅读次数:
149
由于CodeIgniter当初是设计在apache的,而apache对pathinfo是支持比较好的,所以一切都很nice。但是当你把写好的代码放到nginx上,傻眼了,可能出了CodeIgniter的welcom之外,其他都是404错误。而我惊奇的发现,CodeIgniter的官方文档竟然对在Nginx上的配置只字不提。而你百度”CodeIgniter Nginx 404”又能搜到一堆一堆的文章,...
分类:
其他好文 时间:
2015-11-07 09:36:00
阅读次数:
366
1.PATHINFO 模式 常用!!!重点!!! http://域名/项目名/入口文件/模块名/方法名/键1/值1/键2/值2。可以进行参数传值,参考写法如下:在URL里就这样写locallhost:8080/Thinkphp/index.php/index/name/xiaoxiao2.普通...
分类:
Web程序 时间:
2015-11-06 17:50:19
阅读次数:
515
yuminstallnginxmariadb-servermariadbphpphp-mysqlphp-fpmsystemctlstartnginxsystemctlenablenginxnano/etc/php.inicgi.fix_pathinfo=0nano/etc/php-fpm.d/www.confuser=nginxgroup=nginxsystemctlstartphp-fpmsystemctlenablephp-fpmnano/etc/nginx/conf.d/default.confserv..
分类:
其他好文 时间:
2015-11-03 17:58:28
阅读次数:
238
basename()获取文件名代码$path=‘c:\a\b\index.html‘;echobasename($path);输出结果index.htmldirname()获取文件路径代码$path=‘C:\AppServ\www\Basic6\Demo1.php‘;echo‘path:‘.dirname($path);输出结果path:C:\AppServ\www\Basic6pathinfo()获取文件具体信息,包括:目录名、..
分类:
其他好文 时间:
2015-10-30 02:21:10
阅读次数:
164
basename()获取文件名代码$path=‘c:\a\b\index.html‘;echobasename($path);输出结果index.htmldirname()获取文件路径代码$path=‘C:\AppServ\www\Basic6\Demo1.php‘;echo‘path:‘.dirname($path);输出结果path:C:\AppServ\www\Basic6pathinfo()获取文件具体信息,包括:目录名、..
分类:
其他好文 时间:
2015-10-30 02:18:21
阅读次数:
146
我们可以使用PATH_INFO来代替Rewrite来实现伪静态页面, 另外不少PHP框架也使用PATH_INFO来作为路由载体在Apache中, 当不加配置的时候, 对于PHP脚本, Accept pathinfo是默认接受的PATH_INFO是服务器状态中的一个参数,通过$_SERVER['PAT...
分类:
其他好文 时间:
2015-10-30 00:44:27
阅读次数:
409
PATHINFO模式PATHINFO模式是系统的默认URL模式,提供了最好的SEO支持,系统内部已经做了环境的兼容处理,所以能够支持大多数的主机环境。对应上面的URL模式,PATHINFO模式下面的URL访问地址是:http://localhost/index.php/home/user/login...
分类:
Web程序 时间:
2015-10-27 21:57:47
阅读次数:
226