Hello What is the difference between SiteUrl() and BaseUrl() ? In my previous project it is base url but now in my new project it is Siteurl.Why this happens? Is baseurl() is an outdated one
The base URL of the site can be configured in application/config/config. php file. It is URL to your CodeIgniter root.
Base URL: The consistent part or the root of your website's address. For example, http://www.YourDomain.com. Relative URL: The remaining path given after the base URL. For example, /contact_us, /seo/blog/new_post.
site_url()Returns your site URL, as specified in your config file. The index. php file (or whatever you have set as your site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, and the url_suffix as set in your config file.
base_url() is the URL of your CodeIgniter root or the location of the index. php file along with a trailing slash appended to the end of the URL. If the domain name is example.com and the website is using HTTPS as well as www. Further, the index.
Base url for Image / script / css path. site url for Address url for accessing the controllers
echo base_url(); // http://example.com/path/to/your/ci/install
echo site_url(); // http://example.com/path/to/your/ci/install/index.php
You can refer this forum:
http://ellislab.com/forums/viewthread/113974/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With