I have this line in my htaccess which is default (nightly built).
RewriteRule ^(site|kirby|panel/app|panel/test)/.*$ - [NC,R=404]
Blocking site prevents me from loading plugin assets into the template (plugins folder is in the site folder). Let’s say I have a plugin that does this:
function my_plugin_function() {
$root_js = kirby()->urls()->index() . '/site/plugins/my-plugin/assets' . DS . 'js' . DS;
$html = '<script src="' . $root_js . 'my-plugin.js?time=' . time() . '"></script> ';
return $html;
}
echo my_plugin();
That does not work for me. Are we not supposed to have assets in plugins? If so how?
Note
I don’t want to change my htaccess file. The plugin I’m about to make should work on more installations than mine.