hiding CI paths for CSS Images etc.... |
[eluser]Unknown[/eluser]
hello I'have looked into CI www source kode and find this (for CSS src): Code: .... src="http://codeigniter.com/?css=global/sIFR-print.css" ... how is this done??? hiding paths seems more elegant and secure I would like to hide all css, js and images paths. Please help
[eluser]Derek Allard[/eluser]
We built the CodeIgniter site with ExpressionEngine, and this is a standard, "out of the box" feature. It would work differently in CI.
[eluser]Phil Sturgeon[/eluser]
Just create a new controller called media.php with a method for css, javascript, images, etc. Then you just need to use file() to read it and echo the output directly to the browser. Might look something like this: Code: <?php Then just call Quote:media/css/something.css Images might be a bit trickier, and this wouldnt allow subdomains, but you get the idea. Then again... this might not actually achieve anything as it appears to be a fully working path and hotlinking may still work >.<!
[eluser]gyo[/eluser]
Don't you think that using a controller (which seems the easiest solution for me too) will waste a lot of memory and cpu? Because it will reload ALL the framework for each css, with all the autoloads etc... I was thinking of having another php file at the same level of index.php that doesn't rely on the framework. Not sure tho...
|
Welcome Guest, Not a member yet? Register Sign In |