Rewrite

António P. P. Almeida appa at perusio.net
Thu Jun 23 03:32:15 MSD 2011


On 23 Jun 2011 00h25 WEST, lists at silvio-siefke.de wrote:

> Hello, 
>
> i want rewrite my website Blog Sites.
>
> At moment the Sites are blog.html?id=<number>.
>
> I try to rewrite from article-<number>.html to the site
> blog.html?id=<number>.
>
> Im not sure i understand the rewrite docu correct, i has the follow
> lines in the virtuell Server under location / ,
>
> if (!-f $request_filename) {
> rewrite "^/article-([0-9])\.html$ /blogdetail.html?id=$1" last; 
> }

Try this:

location /article-(\d+)\.html$ {
   try_files $uri $uri/ /blog.html?id=$1; # Is it blog.html or blogdetail.hmtl?
}

--- appa




More information about the nginx mailing list