Minify problem on Nginx with WP_CONTENT_DIR set
-
My site is not online, so I will give an example.
Main site is : w3.example.com
Content URL : w3-static.example.comUploads and plugins are in content directory/subdomain.
I have set the following in wp-config.php.
define( 'WP_CONTENT_DIR', '/var/www/w3-static.example.com/wp-content' );
define( 'WP_CONTENT_URL', 'https://w3-static.example.com/wp-content' );
define( 'WP_PLUGIN_DIR', '/var/www/w3-static.example.com/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'https://w3-static.example.com/wp-content/plugins' );
In w3-total-cache/inc/define.php, I added the following code in function w3_filename_to_url just before the last return $url statement:
echo "<!-- w3_filename_to_url " . $filename . " : " . $url . " -->";
In WP W3TC dashboard, i get the following error:W3 Total Cache error:It appears Minify URL rewriting is not working. Please verify that all configuration files are included in the configuration file (and that you have reloaded / restarted nginx).
When I view the source of the admin page, I get the following comment:
<!– w3_filename_to_url /var/www/w3-static.example.com/wp-content/cache/minify/000000/w3tc_rewrite_test : https://w3.example.com/le.com/wp-content/cache/minify/000000/w3tc_rewrite_test –>
The file ‘/var/www/w3-static.example.com/wp-content/cache/minify/000000/w3tc_rewrite_test’ cannot be found and the URL ‘https://w3.example.com/le.com/wp-content/cache/minify/000000/w3tc_rewrite_test’ is also wrong. Note the ‘le.com’ after example.com.
If I remove the WP_ definition in wp-config.php and move the wp-content directory back to the main site, I do not face such issues.
Can we use W3TC with minify option on a different subdomain? I am not on multisite.
- The topic ‘Minify problem on Nginx with WP_CONTENT_DIR set’ is closed to new replies.