Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] Cannot update .htaccess

  • Hi,

    My settings :
    WP 3.0 and WP Super Cache (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.


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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

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

    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;'>

    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;


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

    But maybe it’s not a definitive solution.


    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?

    Plugin Author Donncha O Caoimh


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Super Cache] Cannot update .htaccess’ is closed to new replies.