I need to remove index.php from site_url()
return value
I don't want search engines cache my URLs contain index.php.
I removed index.php from url by setting .htaccess file but still not working.
For example, when I use site_url() in part of my project, search engines cache the URL like http://url/index.php/controller. I remove index.php from site_url function in system/helper but I think the redirect and form_open functions don't work properly.
write in your .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
And set index_page config in config.php
$config['index_page'] = '';
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