2017-09-01 66 views

回答

1

$1$2用于捕获。你必须使用模式与群体创建捕获

下面

location/{ 
    index /index.php; 

    rewrite ^/([^/]+)/([^/]+).html$ /dk/$1/$2.html last; 
} 

或者你也可以做类似下面

location/{ 
    index /index.php; 
    location /accessories/ { 
    alias <yourroot>/dk/accessories/; 
    } 
} 
+0

尝试应该将重写规则是周围的其他方式? '重写^ /([^ /] +)/([^ /] +).html $ /dk/$1/$2.html最后;' – abskmj

+0

@abskmj,的确如此。谢谢! –

+0

没有工作,得到一个内部的nginx错误500 –