how to set base url in codeigniter
Setting Base URL in CodeIgniter
$config['base_url'] = 'http://www.example.com/';
- Open the
config.php
file located in theapplication/config
directory. - Find the line that contains
$config['base_url']
. - Set the value of
$config['base_url']
to the desired base URL, enclosed in single quotes and followed by a trailing slash. - Save the
config.php
file after making the changes.
This sets the base URL for your CodeIgniter application, allowing you to use the base_url()
function and other URL-related functions throughout your application.