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.

  • 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. – KFish May 3 '19 at 0:47