The MU forums have moved to WordPress.org

WP Super Cache: "Mod Rewrite rules cannot be updated!" (5 posts)

  1. qdinar
    Member
    Posted 15 years ago #

    WP Super Cache Manager:
    WP Super Cache Status
    ON (WP Cache and Super Cache enabled)
    ...
    Mod Rewrite Rules
    Mod Rewrite rules cannot be updated!
    You must have BEGIN and END markers in /var/www/dinar/wp/.htaccess for the auto update to work. They look like this and surround the main WordPress mod_rewrite rules:
    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
    Refresh this page when you have updated your .htaccess file.

    my .htaccess file:

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ /$1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

  2. MrBrian
    Member
    Posted 15 years ago #

    Please explain your question before spitting out code for us to interpret.

  3. qdinar
    Member
    Posted 15 years ago #

    hello.
    super cache says that i should surround main wp rules in .htaccess file with "# BEGIN WordPress" and "# END WordPress".
    should i surround "
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    "? (i now think it should be so, and am going to try.)

  4. qdinar
    Member
    Posted 15 years ago #

    i have written and refreshed the super cache control page.
    it have said:
    "To serve static html files your server must have the correct mod_rewrite rules added to a file called /var/www/dinar/wp/.htaccess
    This can be done automatically by clicking the 'Update mod_rewrite rules ยป' button or you can edit the file yourself and add the following rules. Make sure they appear before any existing WordPress rules.
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    ...
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
    # END WPSuperCache

    and there are button "update mod rewritew rules>>".
    i have pressed it.
    it have changed htaccess file , but i don't know whether it is correct. because it says "Make sure they appear before any existing WordPress rules." but they are actually before the "main rules" that i have just determined. so there are "
    RewriteEngine On
    RewriteBase /
    " and "#uploaded files" and "# add a trailing slash to /wp-admin" sections before super cache rules.

  5. qdinar
    Member
    Posted 15 years ago #

    i have moved the super cache rules to the beginning of the file and it seems to be working.

About this Topic