0

Is it possible to redirect JavaScript and CSS calls using something function.php for example?

I used WP Hide & Security to rename some of my plugins and it has functioned well but it clashes with the theme on some of the pages.

From the web console you can see that the pages that it fails on are calling the original paths of the plugins, CSS and JavaScript. I'd like to rewrite the path called for each using functions.

Example error: GET wp-content/plugins/elem/js/status.min.js net::ERR_ABORTED 404 (Not Found)

Or is it possible to rewrite the paths using .htaccess for certain URLs (although WP Hide & Security is already using .htaccess to do its rewrites - so I doubt that would work)

Thank you for your suggestions.

0

This would have to be done via .htaccess or within apache config. PHP code that you place in the functions file, or anywhere else, will never execute when a JS file is loaded directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.