Leave htaccess alone if permalinks are not turned on. Bug 597.

git-svn-id: https://develop.svn.wordpress.org/trunk@2006 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2004-12-27 22:30:52 +00:00
parent 140f5e22b1
commit 8662dfbc33
2 changed files with 27 additions and 12 deletions

View File

@@ -764,6 +764,13 @@ class WP_Rewrite {
's='
);
function using_permalinks() {
if (empty($this->permalink_structure))
return false;
else
return true;
}
function using_index_permalinks() {
if (empty($this->permalink_structure)) {
return false;
@@ -777,6 +784,13 @@ class WP_Rewrite {
return false;
}
function using_mod_rewrite_permalinks() {
if ( $this->using_permalinks() && ! $this->using_index_permalinks())
return true;
else
return false;
}
function preg_index($number) {
$match_prefix = '$';
$match_suffix = '';
@@ -1058,6 +1072,10 @@ class WP_Rewrite {
}
function mod_rewrite_rules () {
if ( ! $this->using_permalinks()) {
return '';
}
$site_root = str_replace('http://', '', trim(get_settings('siteurl')));
$site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root);
if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';