Getting feet wet-- couple of "best practice" questions - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Getting feet wet-- couple of "best practice" questions (/showthread.php?tid=29395) Pages:
1
2
|
Getting feet wet-- couple of "best practice" questions - El Forum - 04-13-2010 [eluser]Fumigator[/eluser] Once I changed from using a full url on my image paths to a relative path, I ran into the problem where if index.php is not in the url, the img path goes wrong. Any solution to that? Getting feet wet-- couple of "best practice" questions - El Forum - 04-13-2010 [eluser]frost9928[/eluser] I opted to use a pre-made .htaccess file which works really well and doesn't get in the way when it comes to images and other such things. Code: <IfModule mod_rewrite.c> Not my work by the way found it through Google and can't find it again to save my life but it works great. Getting feet wet-- couple of "best practice" questions - El Forum - 04-14-2010 [eluser]mddd[/eluser] @Fumigator: If you use urls like css/mycss.css then yes that is a problem because a file that is accessible from / will not be accessible from /mycontroller/mymethod. I always use "semi relative" paths. Like /css/mycss. They are easy to type and read in your view and have no problems if you change domains or subdomains. I know, it is a bit less flexible because you can't put the whole CI structure in a folder but it it very rare that I want to do that. Getting feet wet-- couple of "best practice" questions - El Forum - 04-19-2010 [eluser]Fumigator[/eluser] [quote author="mddd" date="1271245076"]@Fumigator: If you use urls like css/mycss.css then yes that is a problem because a file that is accessible from / will not be accessible from /mycontroller/mymethod. I always use "semi relative" paths. Like /css/mycss. They are easy to type and read in your view and have no problems if you change domains or subdomains. I know, it is a bit less flexible because you can't put the whole CI structure in a folder but it it very rare that I want to do that.[/quote] OK... yeah, this seems to work OK. I'll have to modify my config for different environments but I kind of have to do that anyway. Getting feet wet-- couple of "best practice" questions - El Forum - 04-20-2010 [eluser]dejitaru[/eluser] what about using <base href="<?php echo site_url()?>"> on the views? |