WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Cannot update .htaccess (4 posts)

  1. soleil_levant
    Member
    Posted 4 years ago #

    Hi,

    My settings :
    WP 3.0 and WP Super Cache 0.9.9.3 (the last one)
    WPSC ON, compression disabled, the rest as default.

    To allow WPSC to write its rules in .htaccess, I chmoded
    .htaccess to 666. All works fine. The rules are written and the
    pages cached.

    But, after the installation, when I return .htaccess rights to 644, your plugin displays in the settings page :

    "Cannot update .htaccess
    The file /var/www/etc./httpdocs/.htaccess cannot be modified by the web server. Please correct this using the chmod command or your ftp client."

    So to sum up, with 666 or 644 the plugin works fine. But, with 644 I get the above warning. Is it normal ? May I modify something in the settings to remove this warning ? Because I prefer to keep the 644 rights.

    PG

    PS: Sorry for my pathetic English, I'm not native English speaking.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. soleil_levant
    Member
    Posted 3 years ago #

    Hi,

    Ever the same warning, today with WP 3.0.1 and WP SuperCache 0.9.9.6.

    Maybe there is a mistake in the code of wp-cache.php.

    After the plugin is installed and works, when I display the advanced page in WPSC settings, I see ever the same warning : "Cannot update .htaccess".

    (With .htaccess in 666, no warning. With .htaccess in 644, warning)

    In wp-cache.php, the code is (line 1058) :

    <a href="javascript:toggleLayer('rewriterules');" class="button">
    <?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a>
    <?php wpsc_update_htaccess_form(); ?>
    <div id='rewriterules' style='display: none;'>
    etc.

    So, in any case (before or after update of .htaccess), there is a call to the function wpsc_update_htaccess_form().

    In the body of this function, there is in the beginning :

    if( !is_writeable_ACLSafe( $home_path . ".htaccess" ) )...

    And is_writeable_ACLSafe(/.../.htaccess) return ever false if I chmod
    .htaccess to 644. But, for safety reasons, this file cannot stay in 666.

    To fix this issue, I replace (line 72 in wp-cache.php, after the plugin is updated and working) :

    if ($f===false)
         return false;

    with:

    if ($f===false)
         return true;

    But maybe it's not a definitive solution.

    PG

  3. Rhand
    Member
    Posted 3 years ago #

    I prefer to keep my .htaccess at 644 as well. And I do not want to hack WP Super Cache, but I do prefer all the work and not for the warning to show. If the web server can write all should be good, right?

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Once the plugin updates the .htaccess file it shouldn't need to do so after. There's something else up here. Does it say the rules differ? Do you have mobile support enabled?

    You could also change to PHP caching so the rewrite rules aren't used at all. It's 99% of the speed and only really suffers if your site is hit by a sudden deluge of traffic.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic