iis7_url_rewrite_rules example

'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
                );
                ?> </p> <form action="options-permalink.php" method="post"> <?php wp_nonce_field( 'update-permalink' ); ?> <p> <label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br /> <textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly" aria-describedby="iis-description-a" ><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea> </p> </form> <p> <?php                 printf(
                    /* translators: %s: web.config */
                    __( 'If you temporarily make your %s file writable to generate rewrite rules automatically, do not forget to revert the permissions after the rule has been saved.' ),
                    '<code>web.config</code>'
                );
                ?> </p>
// Ensure get_home_path() is declared.     require_once ABSPATH . 'wp-admin/includes/file.php';

    $home_path       = get_home_path();
    $web_config_file = $home_path . 'web.config';

    // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP.     if ( iis7_supports_permalinks()
        && ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks()
            || win_is_writable( $web_config_file ) )
    ) {
        $rule = $wp_rewrite->iis7_url_rewrite_rules( false );

        if ( ! empty( $rule ) ) {
            return iis7_add_rewrite_rule( $web_config_file$rule );
        } else {
            return iis7_delete_rewrite_rule( $web_config_file );
        }
    }

    return false;
}

Home | Imprint | This part of the site doesn't use cookies.