X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..refs/tags/wordpress-2.8.2:/wp-admin/options-permalink.php diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 93f1619f..4bff30a4 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -70,6 +70,7 @@ add_filter('admin_head', 'add_js'); include('admin-header.php'); $home_path = get_home_path(); +$iis7_permalinks = iis7_supports_permalinks(); if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { check_admin_referer('update-permalink'); @@ -100,12 +101,19 @@ $permalink_structure = get_option('permalink_structure'); $category_base = get_option('category_base'); $tag_base = get_option( 'tag_base' ); -if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) - $writable = true; -else - $writable = false; +if ( $iis7_permalinks ) { + if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') ) + $writable = true; + else + $writable = false; +} else { + if ( ( ! file_exists($home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') ) + $writable = true; + else + $writable = false; +} -if ($wp_rewrite->using_index_permalinks()) +if ( $wp_rewrite->using_index_permalinks() ) $usingpi = true; else $usingpi = false; @@ -115,16 +123,26 @@ $wp_rewrite->flush_rules();

+if ( $iis7_permalinks ) { + if ( $permalink_structure && ! $usingpi && ! $writable ) + _e('You should update your web.config now'); + else if ( $permalink_structure && ! $usingpi && $writable) + _e('Permalink structure updated. Remove write access on web.config file now!'); + else + _e('Permalink structure updated'); +} else { + if ( $permalink_structure && ! $usingpi && ! $writable ) + _e('You should update your .htaccess now.'); + else + _e('Permalink structure updated.'); +} +?> +

-

+

@@ -134,7 +152,7 @@ else /?p=123 - + - + - + /archives/123 @@ -173,13 +191,13 @@ $structures = array( - +

- +

URLs here. For example, using topics as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

URLs here. For example, using topics as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

@@ -188,11 +206,11 @@ $structures = array( - + - +
@@ -200,15 +218,26 @@ $structures = array(

- +

- -

.htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.') ?>

+ +

web.config file were writable, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your web.config file. Click in the field and press CTRL + a to select all. Then insert this rule inside of the /<configuration>/<system.webServer>/<rewrite>/<rules> element in web.config file.') ?>

+
+ +

+
+

web.config file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?>

+ + +

.htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.') ?>

-

+

+