Você não pode incluir a string de consulta na sua cláusula rewrite
(isso exigiria um map
ou if
). Que tal algo como o seguinte?
rewrite ^/forum/rss\.xml$ /forum/index.php?pretty;action=.xml last;
Seus usuários podem acessar seu feed diretamente pelo link
Bem, Simple Machines é uma bagunça terrível, mas simplesmente não há um único software de fórum bom por aí (sempre pensei em iniciar meu próprio projeto de código aberto para essa tarefa).
Por favor, tente o seguinte (corrigindo seu malvado if
de uso):
server {
location / {
location ~ /forum/ {
location ~ /forum/(\.xml|xmlhttp) {
if ($args ~ type=rss) {
rewrite ^/(.*)$ /forum/index.php?pretty;action=$1 last;
try_files $uri @forum;
}
}
try_files $uri @forum;
}
}
location @forum {
# Rules for: profiles
rewrite ^/forum/profile/([^/]+)/?$ "/forum/index.php?pretty;action=profile;user=$1" last;
# Rules for: actions
rewrite ^/forum/(activate|admin|ads|announce|attachapprove|ban|boardrecount|buddy|calendar|clock)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(collapse|convertentities|coppa|credits|deletemsg|detailedversion|display|dlattach|editpoll|editpoll2)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(emailuser|featuresettings|findmember|groups|help|helpadmin|im|jseditor|jsmodify)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(jsoption|lock|lockvoting|login|login2|logout|manageboards|managecalendar|managesearch|manageattachments|maintain|markasread|mascot)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(membergroups|mergetopics|mlist|moderate|modifycat|modifykarma|movetopic|movetopic2|news|notify)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(notifyboard|optimizetables|openidreturn|packages|permissions|pm|post|postsettings|post2|printpage|profile|quotefast)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(quickmod|quickmod2|recent|regcenter|register|register2|reminder|removepoll|removetopic2)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(repairboards|reporttm|requestmembers|restoretopic|reports|search|search2|sendtopic|serversettings|smileys|smstats|suggest)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(spellcheck|splittopics|stats|sticky|theme|trackip|about:mozilla|about:unknown)/?$ "/forum/index.php?pretty;action=$1" last;
rewrite ^/forum/(unread|unreadreplies|verificationcode|viewErrorLog|viewmembers|viewprofile|vote|viewquery|viewsmfile|who)/?$ "/forum/index.php?pretty;action=$1" last;
# Rules for: boards
rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1.0" last;
rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ "/forum/index.php?pretty;board=$1.$2" last;
# Rules for: topics
rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1;topic=$2.0" last;
rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ "/forum/index.php?pretty;board=$1;topic=$2.$3" last;
rewrite ^/(.*)$ /index.php?params=$1 last;
}
}