When using CI frameworks, we often encounter problems with jumps and paths. Site_url() and base_url() are easy to confuse. Let’s talk about their differences below!
If base_url and index_page in your config file are defined like this:
config['base_url'] = "http://domain.com/";
config['index_page'] = "index.php";
Then if you use site_url("news/php/2"); then the actual url is
http://domain.com/index.php/news/php/2
If base_url("news/php/2"); is used, the url is:
http://domain.com/news/php2
No, base_url() is missing an index.php
The above text is very simple. Do you guys understand the difference between site_url() and base_url() in the CI framework? If you have any questions, please leave a message.