首页 > Web开发 > 详细

nginx 隐藏index.php 路径path化

时间:2014-11-03 16:32:50      阅读:315      评论:0      收藏:0      [点我收藏+]

server {

    listen       80 default;

    server_name  _;

        index index.html index.htm index.php;

        #root /alidata/www/default;

        root /alidata/www/sandbox_pro/sandbox;

        #rewrite ^/box/list   /index.php?r=box/list ;

        #rewrite ^/(.*)$   /index.php?r=$1 ;


        if ( -f  $request_filename/index.php) {

                rewrite (.*) $1/index.php;

        }


        if ( !-f $request_filename )  {

                rewrite (.*) /index.php;

        }

        location ~ .*\.(php|php5)?$

        {

                fastcgi_pass  127.0.0.1:9000;

                fastcgi_index index.php;

                include fastcgi.conf;

        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

        {

                expires 30d;

        }

        location ~ .*\.(js|css)?$

        {

                expires 1h;

        }


nginx 隐藏index.php 路径path化

原文:http://dreamingo.blog.51cto.com/6111676/1571265

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!