修复 rewrite规则中archiver/的错误
This commit is contained in:
parent
3d06e0ae75
commit
aca3699abb
|
@ -462,16 +462,13 @@ if($operation == 'filecheck') {
|
||||||
$vkeys = array_keys($rewritedata['rulevars'][$k]);
|
$vkeys = array_keys($rewritedata['rulevars'][$k]);
|
||||||
$rewritedata['rulereplace'][$k] = pvsort($vkeys, $v, $rewritedata['rulereplace'][$k]);
|
$rewritedata['rulereplace'][$k] = pvsort($vkeys, $v, $rewritedata['rulereplace'][$k]);
|
||||||
$v = str_replace($vkeys, $rewritedata['rulevars'][$k], addcslashes($v, '?*+^$.[]()|'));
|
$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";
|
$rulepath = $k != 'forum_archiver' ? '' : 'archiver/';
|
||||||
if($k != 'forum_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.'$ '.$rewritedata['rulereplace'][$k]."&%1\n";
|
$rule['{apache2}'] .= 'RewriteCond %{QUERY_STRING} ^(.*)$'."\n".'RewriteRule ^'.$v.'$ '.$rulepath.$rewritedata['rulereplace'][$k]."&%1\n";
|
||||||
} else {
|
$rule['{iis}'] .= 'RewriteRule ^(.*)/'.$v.'(\?(.*))*$ $1/'.$rulepath.addcslashes(pvadd($rewritedata['rulereplace'][$k]).'&$'.($pvmaxv + 1), '.?')."\n";
|
||||||
$rule['{apache2}'] .= 'RewriteCond %{QUERY_STRING} ^(.*)$'."\n".'RewriteRule ^archiver/'.$v.'$ archiver/'.$rewritedata['rulereplace'][$k]."&%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['{iis}'] .= 'RewriteRule ^(.*)/'.$v.'(\?(.*))*$ $1/'.addcslashes(pvadd($rewritedata['rulereplace'][$k]).'&$'.($pvmaxv + 1), '.?')."\n";
|
$rule['{nginx}'] .= 'rewrite ^([^\.]*)/'.$v.'$ $1/'.$rulepath.stripslashes(pvadd($rewritedata['rulereplace'][$k]))." last;\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";
|
|
||||||
}
|
}
|
||||||
$rule['{nginx}'] .= "if (!-e \$request_filename) {\n\treturn 404;\n}";
|
$rule['{nginx}'] .= "if (!-e \$request_filename) {\n\treturn 404;\n}";
|
||||||
echo str_replace(array_keys($rule), $rule, cplang('rewrite_message'));
|
echo str_replace(array_keys($rule), $rule, cplang('rewrite_message'));
|
||||||
|
|
Loading…
Reference in New Issue