Welcome! Log In Create A New Profile

Advanced

Re: Rewrite - html files without ARGS

November 25, 2010 03:34PM
On Thu, Nov 25, 2010 at 02:09:50PM -0500, stk wrote:

> 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 :/

location /news/ {
location ~ ^/news/(.+)$ {
alias /path/to/files/$1.html;
}
}


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite - html files without ARGS

stk November 25, 2010 02:09PM

Re: Rewrite - html files without ARGS

Igor Sysoev November 25, 2010 03:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 288
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready