• Resolved Amin

    (@aminima)


    Hi there,
    This plugin was working, until I decided to change wp-content folder to a subdomain something like files.example.com.
    I mage a subdomain, and moved the data from wp-content to the subdomain folder, and added these lines to wp-config

    define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/files' );
    define( 'WP_CONTENT_URL', 'https://files.mednet.ir/' );

    after these changes, I noticed Autoptimized doesn’t work. Due to gmetrics info I see lots of css and JSs loding in the website. but befor that I only had one css produced by Autoptimize.

    What should I do now? Do this changes ruined the Autoptimize or something else?!

    Thank you in advance

    https://www.ads-software.com/plugins/autoptimize/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Autoptimize internally tries to map the URL to a filesystem path, but the way you did the change, this will not work. something like

    define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/files' );
    define( 'WP_CONTENT_URL', 'https://files.mednet.ir/files' );

    should work on condition that AO knows that files.mednet.ir is part of the same installation, either by setting your CDN to that URL in autoptimize settings or by using the API (autoptimize_filter_cssjs_multidomain filter, array $in, return $array).

    hope this clarifies,
    frank

    Thread Starter Amin

    (@aminima)

    I beg your pordon, I’m not a developer, If you have free time could you please tell me what should I do exactly? like a documentation, please.

    Plugin Author Frank Goossens

    (@futtta)

    errr …

    1. change your wp-content configuration to ensure it is https://files.mednet.ir/files instead of https://files.mednet.ir/
    2. set your base CDN url in autoptimize to https://files.mednet.ir/

    and see if that fixes your problem?

    frank

    Thread Starter Amin

    (@aminima)

    Thank you for your answer.

    actually it’s not “files” in the subdomain, it’s “content”, excuseme for that.

    But, when I change https://content.mednet.ir/ to https://content.mednet.ir/content in wp-config, nothing loads, and I get a plain html webpage without images or css… note that all folders are directly in the “content” directory of that subdomain.

    /public_html/content/uploads, plugins, themes…

    Plugin Author Frank Goossens

    (@futtta)

    well, obviously you would also have to reconfigure your subdomain (at a webserver level) ??

    frank

    Thread Starter Amin

    (@aminima)

    Tnank you Frank ??

    Plugin Author Frank Goossens

    (@futtta)

    you’re welcome AmiNimA ??

    on a side-note: could you confirm AO 2.0.2 works with wordpress 4.5.2 here (well if it does, at least)?

    frank

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘changing wp-content to subdomain fails Autoptimize’ is closed to new replies.