系統(tǒng)中有一個(gè)需求是將某一段url連結(jié)位址轉(zhuǎn)鏈到另外一段位址,model類似於將
localhost/wish/1234.jhtml自動前往localhost/community/detail/1234.jhtml。
目前Nginx我的設(shè)定寫法是
location ~ ^/wish/$ {
rewrite ^/(.*)$??^/community/detail/$1 permanent;
}
但是運(yùn)行後系統(tǒng)提示404...請問我這句該如何改呢?非常感謝!
設(shè)定檔寫錯(cuò)了,按下面的寫就行,不用放在location下。 rewrite ^/wish/(.*).jhtml$ /community/detail/.jhtml permanent;