server {
if ($host ~* ^example.com) {
rewrite ^(.*) http://www.example.com permanent;
}
}
When I send a request like http://example.com/aa.jsp?time=1
. The forwarded request becomes http://www.example.com/aa.jsp
Are the parameters after the question mark discarded? ? ?
How to set the parameters after the question mark is discarded by the Ministry of Energy? thanks, thanks
大家讲道理2017-05-16 17:26:51
Later I found out that I actually made a mistake during the test. . . After perfecting the test conditions, everything is normal. Thank you for your reply
習慣沉默2017-05-16 17:26:51
if ($host = 'example.com' ) {
rewrite ^/(.*)$ http://www.example.com/$1 permanent;
}