After migrated to a new server, the W3 Total Cache plugin is not working, no cache page or min file redirect, and display following error messages at the W3tc admin page:

It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.

It appears Minify URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.

Environment :

  1. WordPress 3.4.1
  2. W3 Total Cache 0.9.2.4

1 .htaccess Permission

Most cases are caused by file permission of “.htaccess“, find this file at the root of your web directory.

The recommended permission is 644 – chmod 644 .htaccess


-rw-r--r--  1 mkyong mkyong   9988 Aug 23 06:51 .htaccess

If 644 is not working, change it to 664 – chmod 664 .htaccess


-rw-r--r--  1 mkyong mkyong   9988 Aug 23 06:51 .htaccess
Note
Make sure you apply the permission on following directory as well.


./wp-content/w3tc/min/.htaccess 
./wp-content/w3tc/pgcache/.htaccess

P.S Read this Unix File Permission

2. Is Apache support .htaccess?

Check your Apache configuration file – httpd.conf, make sure AllowOverride All is applied on your directory. For example,

File : httpd.conf


<Directory "/your/web/directory">
    AllowOverride All
    Options None
    Order allow,deny
    Allow from all
</Directory>

In short, AllowOverride All supports “.htaccess“, AllowOverride None doesn’t support “.htaccess“.

Note
If you don’t know whether your Apache support .htaccess, ask help from your hosting provider.

3. Invalid .htaccess File

May be you messed up the existing “.htaccess” fine, by accidentally. Try delete the existing “.htaccess” file (remember backup), create a new “.htaccess” and let Wordpress and W3tc plugin to write the rules again.

Or you can download my “.htaccess” file, and compare with yours.

Download my-htaccess.zip (12kb)

4. Sequence of Rules

The w3tc plugin is working properly, but above “Page Cache URL or Minify URL rewriting is not working” error message is display on admin page?

The above problem is caused by the sequence of the rules appear in “.htaccess“, make sure Wordpress’s rule is appear AFTER the w3tc rules.

.htaccess – Correct!


# BEGIN W3TC Page Cache core
#...
# END W3TC Page Cache core

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

.htaccess – Wrong!


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

# BEGIN W3TC Page Cache core
#...
# END W3TC Page Cache core

References

  1. Apache htaccess
  2. Page Cache URL rewriting is not working
  3. W3 Total Cache “Page Cache URL rewriting is not working..” error