Relative link to CSS |
[eluser]ntheorist[/eluser]
Quote:CSS and JS files can easily be seen with Firefox’s Firebug extension. An htaccess protection will not help from someone jacking your files. It would be difficult to completely obfuscate your css/js files. You can use packer, minify etc to make them less readable, but those are all easily reversable its not so much that i don't want people to be able to view the js/css files (easy with the web developer plugin for ff too), its more that i'd rather not advertise the system folder directory, which otherwise would remain in the background. Of course, a better compliment to this would be to rename the system & application directories to something less obvious - a lot of hacking is done by guessing common words/patterns. The .htaccess though should prevent direct system folder access. And of course placing <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); at the top of all your php scripts and views, plus adding a blank index.html file helps too. The best way i know of to protect system files is to place it outside (beneath) your web root on your server. Admittedly i haven't tried this yet - thread on it here - but it seems it would make it impossible to access your system folder through the browser, making it very secure from prying eyes. Quote:I myself dont want to use full urls everywhere because it creates http request on every load and for page with lots of images, styles, js etc. it will slow down the site. chad is right that absolute/relative urls wont make a difference. However, you DO save http requests by combining your css and js files and i highly recommend it. I tend to have 10-12 stylesheets and multiple jquery plugins used while developing a normal sized site. That's an http request for every <link href=".."> and every javascript link. You can use a class to compress/combine them all into one file on a per-page basis, so you'd have <link href="styles/cache/45456465143621514.css"> or whatever, which is just one file with all the css in it. Same for the js, and you reduce reqests from 20+ to 2. Much more efficient. I recommend the carabiner library, as it was plug-n-play for me. Also, i do know that FF and maybe other browsers have a habit of 'preloading' links on a webpage, even if you never ever visit them. This makes them huge memory hogs and there are tweaks you can do on your browser (type about:config in the url & google 'firefox memory tweaks'), but there's nothing you can do about the browsers of people visiting your site. Quote:One last question, how are you guys loading the URL helper in a view?..Views do exist in the same scope as the controller you called them in so you can use $this->load->helper('url') in a view just like you could in a controller/model. It's not good MVC practice so much, but really its just a matter of your preference and if you can keep track of where you use 'controller' code in your views. On a big site/CMS this would get messy n |
Messages In This Thread |
Relative link to CSS - by El Forum - 07-08-2009, 06:48 PM
Relative link to CSS - by El Forum - 07-08-2009, 07:05 PM
Relative link to CSS - by El Forum - 07-08-2009, 07:35 PM
Relative link to CSS - by El Forum - 07-08-2009, 08:03 PM
Relative link to CSS - by El Forum - 07-08-2009, 08:30 PM
Relative link to CSS - by El Forum - 07-08-2009, 09:14 PM
Relative link to CSS - by El Forum - 07-09-2009, 06:20 AM
Relative link to CSS - by El Forum - 07-09-2009, 11:36 AM
Relative link to CSS - by El Forum - 07-09-2009, 11:52 AM
Relative link to CSS - by El Forum - 07-09-2009, 05:51 PM
Relative link to CSS - by El Forum - 07-09-2009, 07:27 PM
Relative link to CSS - by El Forum - 07-09-2009, 07:30 PM
Relative link to CSS - by El Forum - 07-09-2009, 07:44 PM
Relative link to CSS - by El Forum - 07-09-2009, 10:28 PM
Relative link to CSS - by El Forum - 07-10-2009, 12:15 PM
Relative link to CSS - by El Forum - 07-10-2009, 12:21 PM
Relative link to CSS - by El Forum - 07-10-2009, 01:20 PM
Relative link to CSS - by El Forum - 07-10-2009, 01:39 PM
Relative link to CSS - by El Forum - 07-10-2009, 02:26 PM
Relative link to CSS - by El Forum - 07-10-2009, 02:44 PM
Relative link to CSS - by El Forum - 07-10-2009, 02:48 PM
Relative link to CSS - by El Forum - 07-10-2009, 03:20 PM
Relative link to CSS - by El Forum - 07-10-2009, 03:43 PM
Relative link to CSS - by El Forum - 07-10-2009, 04:22 PM
Relative link to CSS - by El Forum - 07-10-2009, 04:23 PM
Relative link to CSS - by El Forum - 07-10-2009, 04:52 PM
Relative link to CSS - by El Forum - 07-10-2009, 05:54 PM
Relative link to CSS - by El Forum - 07-10-2009, 06:43 PM
Relative link to CSS - by El Forum - 07-10-2009, 07:15 PM
|