2017-09-01 48 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 –