Search code examples
phpjavascriptcsscodeigniterpublic

loading css or javascript from non-public directory


is there a way to load css and/or javascript files from outside of the public web directory?

for example on my hosting service i have /public_html but don't want these files to exist in the public directory and want them in a directory outside of the public directory in a sibling directory /system (i am using codeigniter) within the /system/application/view/


Solution

  • Yes -- in a way -- and Minify [http://code.google.com/p/minify/] is one approach.

    Look at line 39 of the config file [http://code.google.com/p/minify/source/browse/trunk/min/config.php]. Here you will see where your minified cache sits outside of the web root. Now, I do not know if the source JS and CSS can sit in the same directory as the cache.