Support » Plugin: W3 Total Cache » change wp-content path and minify problem

  • Hi,

    I have changed wp-content path by following code in wp-config:

    define( ‘WP_CONTENT_DIR’, $_SERVER[“DOCUMENT_ROOT”] . ‘/files’ );
    define( ‘WP_CONTENT_URL’, ‘https://files.site.com’ );
    define( ‘COOKIE_DOMAIN’, ‘https://site.com’ );

    All things working fine. Just there is a problem for minify css & js. W3 can generate minified files and call them, but the htaccess in cache folder caused problem for loading the files. If i remove the htaccess, it works.

    Can you help for this?

    Thank you very much

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor gidomanders

    (@gidomanders)

    Your setup is like a CDN, but W3 doesn’t know that. So it only allows for files to be loaded from your main URL.

    You could use self hosted CDN to change the allowed URLs in the htaccess files. Otherwise please share any console errors you see in your browser’s developer tools.

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    (index):1 Resource interpreted as Stylesheet but transferred with MIME type text/html: “https://files.site.com/cache/minify/8c1ac.default.include.c283c1.css”.
    (index):1 Resource interpreted as Stylesheet but transferred with MIME type text/html: “https://files.site.com/wp-includes/css/dashicons.min.css”.
    (index):1 Resource interpreted as Stylesheet but transferred with MIME type text/html: “https://files.site.com/wp-includes/css/admin-bar-rtl.min.css”.
    (index):1 The resource https://site.com/cache/minify/8c1ac.default.include.c283c1.css was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it Please make sure it has an appropriate as value and it is preloaded intentionally.
    (index):1 The resource https://site.com/cache/minify/8c1ac.default.include-footer.044424.js was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it Please make sure it has an appropriate as value and it is preloaded intentionally.
    (index):1 The resource https://site.com/cache/minify/8c1ac.default.include.ff62b0.js was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it Please make sure it has an appropriate as value and it is preloaded intentionally.

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    CDN settings:

    FTP hostname: 127.0.0.1
    FTP path: public_html/files
    Replace site’s hostname with: files.site.com

    Test Ftp Server: Test passed

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    Also w3 can not created minified files in files/cache/minify path ! Here is just create htaccess and index.html

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    If i un-checked Host attachments and … in general settings in CDN, It will create minified files. But when want to call them, there is a problem. htaccess in cache folder do not allow call. Also w3 try to call them from incorrect path: site.com/cache/minify

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    Debug minify:

    W3 Total Cache error:It appears Minify URL rewriting is not working. Please verify that the server configuration allows .htaccess
    Unfortunately minification will not function without custom rewrite rules. Please ask your server administrator for assistance. Also refer to the install page for the rules for your server.
    Technical info

    .htaccess file contains rules to rewrite url https://files.site.com/cache/minify/653883865w3tc_rewrite_test.css. If handled by plugin, it returns “Minify OK” message.
    The plugin made a request to https://files.site.com/cache/minify/653883865w3tc_rewrite_test.css but received:
    Array
    (
    [code] => 200
    [message] => OK
    )

    Plugin Contributor gidomanders

    (@gidomanders)

    I talked to the team and we’ve decided to add support for overwritten WP_CONTENT_DIR and WP_CONTENT_URL constant. This should fix your issues in the next release.

    Thread Starter dehkadeh wp

    (@dehkadehwp)

    Thank you sir. This is a good sound 🙂

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @dehkadehwp,

    @gidomanders stated this issue will be fixed in the next release. Please close the topic if convenient and mark it as resolved.
    Best regards,

    Marko

    Hi,

    I just installed today W3 Total Cache plugin (latest version).

    The same error URL rewriting is still showing.

    SITUATION DESCRIPTION

    Default is set Page Cache Method to:

    Disc: Enchanced

    In this setting following error is shown:

    W3 Total Cache error: It appears Page Cache URL rewriting is not working. Please verify that the server configuration allows .htaccess
    Unfortunately disk enhanced page caching will not function without custom rewrite rules. Please ask your server administrator for assistance. Also refer to the install page for the rules for your server.

    Technical info

    .htaccess file contains rules to rewrite url https://www.j-dsgn.nl/w3tc_rewrite_test into https://www.j-dsgn.nl/?w3tc_rewrite_test which, if handled by plugin, return “OK” message.
    The plugin made a request to https://www.j-dsgn.nl/w3tc_rewrite_test but received:
    404 Not Found
    instead of “OK” response.

    See screenshot:

    https://snag.gy/fIdU5V.jpg

    When set Page Cache Method to:

    Disk: Basic

    The error disapears and seems to be solved.

    See screenshot:

    https://snag.gy/IbqoHE.jpg

    QUESTION

    1A. Plugin fix

    Does the latest version plugin contains the fix already?

    If answere 1A is: Yes, go to 1B.

    1B. Error URL rewriting

    There is shown error: URL rewriting is not working, when set Page Cache Method: Disc: Enchanced.

    Can you fix this error please?

    Thanks in advance.

    Best regards,

    Joris

    Plugin Contributor gidomanders

    (@gidomanders)

    @joris-van-der-horst your problems are not related to the problems with the directory. But to answer your question, you can use disk enhanced if your server setup allows htaccess and you have mod_rewrite enabled. The error you see shows that your setup does not. To change that, you could contact your hosting provider for help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘change wp-content path and minify problem’ is closed to new replies.