[eluser]cahva[/eluser]
[quote author="Fumigator" date="1271121420"]
Yeah... this was something that was bothering me, why would I want a URL reference to every image? So I've taken your advice and added a constant that I can use to create a relative reference to my images. Thanks.[/quote]
..or just change your $config['base_url']
I have this set up in almost every project and have no problem at all:
Code:
$config['base_url'] = "/";
That way you can use site_url, anchor etc. everywhere. As it is pointed out, browser will know in which domain you are on
Ofcourse full url is sometimes needed(for example payment methods which want return url) and therefore I add something like $config['full_url'] = 'http://www.somedomain.tld/' which can be then grabbed with config_item('full_url') when I need it somewhere.