Welcome Guest, Not a member yet? Register   Sign In
hiding CI paths for CSS Images etc....
#4

[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
class Media extends Controller {
    function css($file)
    {
        $this->load->helper('file');
        $this->output->set_header("content-type: text/css");
        $this->output->set_output(read_file('./media/css/'.$file));
    }

    function javascript($file)
    {
        $this->load->helper('file');
        $this->output->set_header("content-type: application/x-javascript");
        echo read_file('./media/js/'.$file);
    }

}
?>

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 >.<!


Messages In This Thread
hiding CI paths for CSS Images etc.... - by El Forum - 08-03-2007, 01:19 AM
hiding CI paths for CSS Images etc.... - by El Forum - 08-03-2007, 11:33 AM
hiding CI paths for CSS Images etc.... - by El Forum - 08-04-2007, 03:14 AM
hiding CI paths for CSS Images etc.... - by El Forum - 08-04-2007, 01:41 PM
hiding CI paths for CSS Images etc.... - by El Forum - 04-14-2009, 04:05 AM
hiding CI paths for CSS Images etc.... - by El Forum - 04-14-2009, 04:30 AM
hiding CI paths for CSS Images etc.... - by El Forum - 04-14-2009, 05:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB