Fix support for rewrites on IIS7. Fixes #12973 props Frumph and ruslany.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-04-29 21:41:20 +00:00
parent 79ccf9e0c7
commit 2c1cc83750
1 changed files with 3 additions and 3 deletions

View File

@ -488,7 +488,7 @@ function iis7_rewrite_rule_exists($filename) {
if ( $doc->load($filename) === false )
return false;
$xpath = new DOMXPath($doc);
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']');
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
if ( $rules->length == 0 )
return false;
else
@ -517,7 +517,7 @@ function iis7_delete_rewrite_rule($filename) {
if ( $doc -> load($filename) === false )
return false;
$xpath = new DOMXPath($doc);
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']');
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
if ( $rules->length > 0 ) {
$child = $rules->item(0);
$parent = $child->parentNode;
@ -557,7 +557,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
$xpath = new DOMXPath($doc);
// First check if the rule already exists as in that case there is no need to re-add it
$wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']');
$wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
if ( $wordpress_rules->length > 0 )
return true;