nginx 隱藏index.php 路徑path化

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;

        }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章