作者:mobiledu2502862777 | 来源:互联网 | 2024-11-12 13:55
两个条件,组合控制#if($query_string~*modviewthread&t(&extra(.*)))?$)#{#set$itid$1;#rewrite^
两个条件,组合控制
# if ($query_string ~* "mod=viewthread&tid=([0-9]+)((&highlight=(.*))|(&extra=(.*)))?$")
# {
# set $itid $1;
# rewrite ^([^\.]*)/forum\.php$ http://xxx.xxx.com/thread-$itid-1-1.html? permanent;
# }
set $has_authorid ‘0‘;
set $itid ‘0‘;
if ($query_string ~* "&authorid=")
{
set $has_authorid ‘1‘;
}
if ($query_string ~* "mod=viewthread&tid=([0-9]+)((&highlight=(.*))|(&extra=(.*)))?$")
{
set $itid $1;
}
set $redirect_thread "$has_authorid$itid";
if ($redirect_thread ~ ‘0([1-9]\d+)‘)
{
rewrite ^([^\.]*)/forum\.php$ http://xxx.xxx.com/thread-$itid-1-1.html? permanent;
}
rewrite nginx