• Resolved Rookie

    (@alriksson)


    When installed in subdirectory I get 404 on all minified assets and MIME type issue stylesheets are recognized as text/html.

    The htaccess rule when using _static/??/ require to be more dynamic if you changed content folder name via WP_CONTENT_DIR and WP_CONTENT_URL. I did test changing it from wp-content/ in the rewrite rule to just content/ to match without success.

    RewriteRule ^_static/.* wp-content/plugins/powered-cache/includes/file-optimizer.php [L]
    RewriteRule ^_static/.* content/plugins/powered-cache/includes/file-optimizer.php [L]


    But somehow must be that _static/??/ path does exist but feels it doesn’t exist which is why the MIME rules not working even I added into the htaccess.

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter Rookie

    (@alriksson)

    File-optimizer doesn’t support the use of hooks because it doesn’t load WordPress. However, you have the option to define constants prior to their definition in the file. For example, you can use a custom .user.ini file to load a PHP file containing your custom definitions.


    Can you and an example in your docs?

    There’s no need to use rewrite; the appearance of the URL, whether it’s well-structured or not, doesn’t impact its functionality. It will work effectively regardless.

    File Optimizer is doing optimizations on the fly, and it’s more efficient for large-scale WordPress installations and it’s able to optimize assets for logged-in users too. (it’s sort of a custom implementation of nginx-http-concat)

    It’s true, it just itches my eye having these file endings as .php in a URL its old school, so I prefer the rewrite and pretty URLs.

    I made some adjustments in version 3.3.2 to support the custom wp-content structure. You may still need to tweak settings a little bit, but I think it’s better for a custom directory structure.

    Great! ok do you know right off what I will need to tweak in settings and still make edits in the original files?

    Will it work with rewrites now as well? Or only with the .php optimizer and without rewrites of the url?

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @alriksson,

    Can you and an example in your docs?

    No, because it’s not a thing I’d support. With the recent changes, custom directory structures will be supported without modification. (I’ve removed hardcoded wp-content)

    It’s true, it just itches my eye having these file endings as .php in a URL its old school, so I prefer the rewrite and pretty URLs.

    Yeah, this is why we introduced rewrite support for the file optimizer. If you are unable to update .htaccess, you’ll still need to add a manual rule, but it should work pretty well in most environments.

    Great! ok do you know right off what I will need to tweak in settings and still make edits in the original files?

    Nope, it should be working fine without editing original files.

    Will it work with rewrites now as well? Or only with the .php optimizer and without rewrites of the url?

    Yes, it should work with rewrites if it supports automatic .htaccess updates and if you enable the rewrite setting. If you are using nginx, you need to add rewrite rules there. (you can download pre-configured settings under MISC tab)

    Please give it a try and let me know if it doesn’t work.

    Thread Starter Rookie

    (@alriksson)

    No, because it’s not a thing I’d support. With the recent changes, custom directory structures will be supported without modification. (I’ve removed hardcoded wp-content)

    Ok, but now it should work out of the box, so there’s no need.

    Perfect, thanks; then everything should be sorted. I will test these days and let you know!

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘404 MIME type issue’ is closed to new replies.