There is a requirement in the system to transfer a certain url link address to another address. The model is similar to
localhost/wish/1234.jhtml automatically goes to localhost/community/detail/1234.jhtml.
Currently my configuration writing method for Nginx is
location ~ ^/wish/$ {
rewrite ^/(.*)$ ^/community/detail/$1 permanent;
}
But after running, the system prompts 404...How should I change this sentence? Thank you so much!
PHP中文网2017-05-16 17:28:14
The configuration file is written incorrectly. Just write it as below. There is no need to put it under location. rewrite ^/wish/(.*).jhtml$ /community/detail/.jhtml permanent;