Remove index.php from site_url function in codeigniter
write in your .htaccess file
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php/$0 [PT,L]
And set index_page config in config.php
$config['index_page'] = '';
You can use base_url()
function:
echo base_url(); // http://example.com/websiteecho site_url(); // http://example.com/website/index.php