diff --git a/upload/source/admincp/admincp_checktools.php b/upload/source/admincp/admincp_checktools.php index cd814e4..44fad5e 100644 --- a/upload/source/admincp/admincp_checktools.php +++ b/upload/source/admincp/admincp_checktools.php @@ -462,16 +462,13 @@ if($operation == 'filecheck') { $vkeys = array_keys($rewritedata['rulevars'][$k]); $rewritedata['rulereplace'][$k] = pvsort($vkeys, $v, $rewritedata['rulereplace'][$k]); $v = str_replace($vkeys, $rewritedata['rulevars'][$k], addcslashes($v, '?*+^$.[]()|')); - $rule['{apache1}'] .= "\t".'RewriteCond %{QUERY_STRING} ^(.*)$'."\n\t".'RewriteRule ^(.*)/'.$v.'$ $1/'.pvadd($rewritedata['rulereplace'][$k])."&%1\n"; - if($k != 'forum_archiver') { - $rule['{apache2}'] .= 'RewriteCond %{QUERY_STRING} ^(.*)$'."\n".'RewriteRule ^'.$v.'$ '.$rewritedata['rulereplace'][$k]."&%1\n"; - } else { - $rule['{apache2}'] .= 'RewriteCond %{QUERY_STRING} ^(.*)$'."\n".'RewriteRule ^archiver/'.$v.'$ archiver/'.$rewritedata['rulereplace'][$k]."&%1\n"; - } - $rule['{iis}'] .= 'RewriteRule ^(.*)/'.$v.'(\?(.*))*$ $1/'.addcslashes(pvadd($rewritedata['rulereplace'][$k]).'&$'.($pvmaxv + 1), '.?')."\n"; - $rule['{iis7}'] .= "\t\t".'<rule name="'.$k.'">'."\n\t\t\t".'<match url="^(.*/)*'.str_replace('\.', '.', $v).'\?*(.*)$" />'."\n\t\t\t".'<action type="Rewrite" url="{R:1}/'.str_replace(array('&', 'page\%3D'), array('&amp;', 'page%3D'), addcslashes(pvadd($rewritedata['rulereplace'][$k], 1).'&{R:'.$pvmaxv.'}', '?')).'" />'."\n\t\t".'</rule>'."\n"; - $rule['{zeus}'] .= 'match URL into $ with ^(.*)/'.$v.'\?*(.*)$'."\n".'if matched then'."\n\t".'set URL = $1/'.pvadd($rewritedata['rulereplace'][$k]).'&$'.$pvmaxv."\nendif\n"; - $rule['{nginx}'] .= 'rewrite ^([^\.]*)/'.$v.'$ $1/'.stripslashes(pvadd($rewritedata['rulereplace'][$k]))." last;\n"; + $rulepath = $k != 'forum_archiver' ? '' : 'archiver/'; + $rule['{apache1}'] .= "\t".'RewriteCond %{QUERY_STRING} ^(.*)$'."\n\t".'RewriteRule ^(.*)/'.$v.'$ $1/'.$rulepath.pvadd($rewritedata['rulereplace'][$k])."&%1\n"; + $rule['{apache2}'] .= 'RewriteCond %{QUERY_STRING} ^(.*)$'."\n".'RewriteRule ^'.$v.'$ '.$rulepath.$rewritedata['rulereplace'][$k]."&%1\n"; + $rule['{iis}'] .= 'RewriteRule ^(.*)/'.$v.'(\?(.*))*$ $1/'.$rulepath.addcslashes(pvadd($rewritedata['rulereplace'][$k]).'&$'.($pvmaxv + 1), '.?')."\n"; + $rule['{iis7}'] .= "\t\t".'<rule name="'.$k.'">'."\n\t\t\t".'<match url="^(.*/)*'.str_replace('\.', '.', $v).'\?*(.*)$" />'."\n\t\t\t".'<action type="Rewrite" url="{R:1}/'.str_replace(array('&', 'page\%3D'), array('&amp;', 'page%3D'), $rulepath.addcslashes(pvadd($rewritedata['rulereplace'][$k], 1).'&{R:'.$pvmaxv.'}', '?')).'" />'."\n\t\t".'</rule>'."\n"; + $rule['{zeus}'] .= 'match URL into $ with ^(.*)/'.$v.'\?*(.*)$'."\n".'if matched then'."\n\t".'set URL = $1/'.$rulepath.pvadd($rewritedata['rulereplace'][$k]).'&$'.$pvmaxv."\nendif\n"; + $rule['{nginx}'] .= 'rewrite ^([^\.]*)/'.$v.'$ $1/'.$rulepath.stripslashes(pvadd($rewritedata['rulereplace'][$k]))." last;\n"; } $rule['{nginx}'] .= "if (!-e \$request_filename) {\n\treturn 404;\n}"; echo str_replace(array_keys($rule), $rule, cplang('rewrite_message'));