• I have my wordpress install in a directory called “blog” but the website address is my home directory. Consequently that’s where my Index.php file is. However, if I try to edit it using the templates admin page I get the old index file which still resides in my blog directory. Putting “..\index.php” as the file name returns “cannot edit a file beginning with ..” or something similar. Putting in the full path gets me a “no such file”
    Any suggestions as to how I can edit my wp-admin\templates.php file so that it points to the correct index file (or any other solution to my problem). This question was asked previously but attracted no satisfactory answer.
    Thanks
    Graham

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am curious about this one too as I am in the same boat..any info would be great for both of us 🙂
    Thanks

    Try just \index.php ….. with out the . or ..
    TG

    Tried that and it didn’t work
    Jeff

    go into the wp-admin folder and edit the templates.php file.
    look for the validate_file function. comment out using // the first if statement and the corresponding die function. also comment out the line just before the return at the end.
    validate_file function should then look like this:
    function validate_file($file) {
    //if (‘..’ == substr($file,0,2))
    //die (__(‘Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.’));
    if (‘:’ == substr($file,1,1))
    die (__(‘Sorry, can’t call files with their real path.’));
    if (‘/’ == substr($file,0,1))
    $file = ‘.’ . $file;
    $file = stripslashes($file);
    //$file = str_replace(‘../’, ”, $file);
    return $file;
    }

    i advise not making the above edit if you’re in a multi user environment with template editing privileges.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Editing Index.php via template page.’ is closed to new replies.