Error appears after updating site settings (v. 2.9)

After changing site settings, you see the error:

Warning: file_get_contents(../.htaccess) [function.file-get-contents]: failed to open stream: No such file or directory in /home/username/public_html/storeadmin/variables.php on line 159

or, if you do not have advanced site permissions, your site extensions don't work.

Option 1: Add a blank .htaccess file to the main public folder of your site. (This is the same folder that contains the stconfig.php file.)

OR

Option 2: Change the coding as follows:

  1. Open the variables.php file in the /storeadmin/ folder.

  2. Find the code:

    $showquery = "SELECT SubGroup, GivePermission FROM " .SB_DB_PREFIX ."_permissions WHERE SetPg='$setpg' AND SubGroup<>''";

    around line 20

  3. Add the code:

    else
    file_put_contents('../.htaccess', '');

    just above that line.

  4. Find the code around line 110:

    // Update catalog page as well
    if ($basecatalogpg != $catalogpage)
    {

    and add:

    // ONLY CHANGE EXTENSIONS IF PERMISSION TO DO SO
    if ($set_master_key == "yes" OR $show_advanced == "Yes")
    {

    just above it.

  5. Find the code around line 177:

    $updmsg .= "
    Your htaccess file was updated.";

    and add:

    }

    just after it.

  6. Optional: Find the code around line 344:

    echo "updated.
    $updmsg
    ";

    and change it to:

    echo "updated.
    $updmsg
    ";