Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference betwwen CodeIgniter Site Url and base Url

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

like image 237
Nidheesh Avatar asked Dec 24 '13 17:12

Nidheesh


People also ask

What is the use of base URL in CodeIgniter?

The base URL of the site can be configured in application/config/config. php file. It is URL to your CodeIgniter root.

What is a base URL?

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.

What is Site_url in CodeIgniter?

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.

What is base_url () in php?

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.


1 Answers

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/

like image 116
Kumar V Avatar answered Sep 18 '22 18:09

Kumar V