Rewrite - html files without ARGS

stk nginx-forum at nginx.us
Thu Nov 25 22:09:50 MSK 2010


Hello,

I wanted to rewrite this url

news/any_file-name-1-9?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+homeinteriors+(Design+Interior)


To

news/any_file-name-1-9.html

I wrote
************************************
location = /news {
if ($args ~ ^ utm_source) {
set $args “”;
}	
}
***********************************
OR
**********************************
location ~* ^.+\.(htm|html)$ {
if ($args != "") {
set $args “”;
}
**********************************


But it doesn't work

Can anyone help me? Let me know what I'm doing wrong :/

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,153328,153328#msg-153328




More information about the nginx mailing list