[Rewrite] Url - rewriting

CactO_o's nginx-forum at nginx.us
Sat Aug 1 14:53:54 MSD 2009


Thank you Igor but I think your reply is incorect ... 

In your exemple : 


server {
server_name domain.tlm;

location / {
rewrite ^/(.*).html$ http://www.domain.tlm/index.php?sd=&page=$1;
}

location /php/ {
rewrite ^/(.*).html$ http://www.domain.tlm/index.php?sd=;
}

return 404;
}

server {
server_name www.domain.tlm;

location ~ \.html$ {
rewrite ^/(.*).html$ http://www.domain.tlm/index.php?page=$1;
}

...
}


You don't redirect the sub-domain... Juste if is empty...
And you juste redirect the HTML page on sub-domain empty, or WWW sub-domain ... =s

*************************************************************************************

Other question : It's possible to just add a GET argument ?? 

Exemple : 

if( $host ~* "(.*)\.*\.{2,4}" )
{
    addGet sd $1;
}


Thank all for help !

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






More information about the nginx mailing list