Welcome Guest, Not a member yet? Register   Sign In
How to avoid using <?=base_url();?> in link href?
#3

[eluser]Rick Jolly[/eluser]
[quote author="huzzi" date="1262904051"]If you CI codes in the root folder then you don't have to use base_url() .. someone correct me if i'm wrong.[/quote]
Yes, if you use absolute urls (starting with a "/"). But that isn't portable since you can't be sure you'll never move to a subdirectory. You can use <base href="<?=base_url()?>"/> in the head and then make all your urls relative.


Messages In This Thread
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 10:13 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 10:40 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 11:53 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 12:22 PM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 12:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB