On 25 Jul 2011 13h35 WEST, nginx-forum@nginx.us wrote:
> I use this rewrite rule to create SEO friendly urls
> rewrite ^/search/(.*).html /search.php?q=$1 last;
Try this:
location ~ ^/(?<file1>[^/]*)/(?<file2>.*)\.html$ {
return 302 /$file1.php?q=$file2;
}
Or the more "standard" approach:
location ~ /(?<file>[^/]*)/(?<file2>.*)\.html$ {
rewrite ^ /$file1.php?q=$file2 last;
}
--- appa
PS: Don't know which version if Nginx is required to make the first
rule work. It's an undocumented feature. It works with 1.0.5. Try it.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx