Welcome Guest, Not a member yet? Register   Sign In
Dynamic Base URL
#1

[eluser]Tejas D[/eluser]
Hello....


I developed a website using CodeIgniter.
I configure base url as below (for eg):
Code:
$config['base_url'] = 'http://abc.pqr.net/';

Till now website is working fine.

My question is can I set the above base url parameter dynamically depending on user type the address in browser.

eg:
if in browser user type
Code:
http://xyz.abc.net/
then I want to set this to base url in config file.


#2

[eluser]rana[/eluser]
Which version of codeigniter are you using? Use the latest version and keep this field empty:
Code:
$config['base_url'] = '';
The latest version is pretty intelligent to detect the base_url itself and it will do your work fine. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB