WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Minify fails / RewriteBase: argument is not a valid URL (5 posts)

  1. James Revillini
    Member
    Posted 2 years ago #

    SUMMARY
    W3 Total Cache's Minify URL doesn't work on a XAMPP installation. In the dashboard, after enabling Minify with the default settings, the user gets an error "It appears Minify URL rewriting is not working..." and nothing gets Minified.

    PROCEDURE

    1. install XAMPP on windows
    2. install wordpress
    3. install w3 total cache
    4. enable Minify

    EXPECTED
    Minification of JS and CSS

    OUTCOME
    Error visible on-screen: "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."

    Error in apache error log: [Mon Sep 26 15:50:43 2011] [alert] [client xxx.xx.xx.xxx] /blah/wp-content/w3tc/min/.htaccess: RewriteBase: argument is not a valid URL

    NOTES
    To really test, I attempted to go to the test URL http://path/to/wp/wp-content/w3tc/min/w3tc_rewrite_test and I got a 500 internal server error (log entry is above). I changed the RewriteBase line to read RewriteBase /wpdir/wp-content/w3tc/min/ and executed the URL in the browser and got 'OK' back. So I assume this is the correct line to have on a XAMPP installation, however W3TC doesn't like it. It considers Minify to be disabled at that point and outputs: "Minify is not active. To enable it, add the following rules into the server configuration file ..."

    I also tried selecting the option not to check the rewrite rules but then it's still not attempting to minify.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. James Revillini
    Member
    Posted 2 years ago #

    I think I found the issue.
    wpdir\wp-content\plugins\w3-total-cache\lib\W3\Plugin\MinifyAdmin.php:
    $cache_dir = str_replace(w3_get_document_root(), '', w3_path(W3TC_CACHE_FILE_MINIFY_DIR));

    The document root is not always the site root. I have WP in E:/newsite but my document root is E:/oldsite.

    So if you try to replace E:/oldsite with '' in the string E:/oldsite/wp-content/w3tc/min/, you still have E:/oldsite/wp-content/w3tc/min/

    I dunno - I think this is the problem. If I hardcode the absolute URL to the min directory, it saves and stops giving me errors, however I don't see it minifying the javascript still.

    I'm still trying to figure out what the replacement code should be so it's not hardcoded.

  3. cyonite
    Member
    Posted 2 years ago #

    Can you submit a bug submission form from the support tab of the plugin because we are unable to duplicate and need to learn more?

  4. James Revillini
    Member
    Posted 2 years ago #

    Will do.

  5. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks, this is fixed in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic