Make WordPress Core


Ignore:
Timestamp:
08/27/2004 05:20:59 AM (20 years ago)
Author:
rboren
Message:

Eliminate use of DOCUMENT_ROOT. Look for .htaccess in 'home'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r1535 r1567  
    1919        }
    2020    }
     21}
     22
     23$home = get_settings('home');
     24if ($home != '' && $home != get_settings('siteurl')) {
     25  $home_path = parse_url($home);
     26  $home_path = $home_root['path'];
     27  $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
     28  $home_path = $root . $home_path . "/";
     29} else {
     30  $home_path = ABSPATH;
    2131}
    2232
     
    4858<?php if(isset($_POST['rules'])) {
    4959        $rules = explode("\n", $_POST['rules']);
    50         if(insert_with_markers(ABSPATH.'.htaccess', 'WordPress', $rules)) {
     60        if(insert_with_markers($home_path.'.htaccess', 'WordPress', $rules)) {
    5161?>
    5262<div class="updated" id="htupdate"><p><?php _e('mod_rewrite rules written to .htaccess.'); ?></p></div>
     
    137147    </p>
    138148<?php
    139 if ((! file_exists(ABSPATH.'.htaccess') && is_writable(ABSPATH)) || is_writable(ABSPATH.'.htaccess')) {
     149
     150if ((! file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess')) {
    140151?>
    141152    <p class="submit">
Note: See TracChangeset for help on using the changeset viewer.