I removed index.php from url by installing the .htaccess file. Now I want to remove index.php from the return value of site_url (), because I do not want search engine caches to contain my index.php URLs. For example, when I use site_url () as part of my project, search engines cache the URL, for example http: //url/index.php/controller . I remove index.php from the site_url function in system / helper, but I think the redirect functions and form_open are not working properly.
write in the .htaccess file
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L]
And set the index_page configuration in config.php
$config['index_page'] = '';
You can use the base_url() function:
base_url()
echo base_url(); // http://example.com/website echo site_url(); // http://example.com/website/index.php
Source: https://habr.com/ru/post/984368/More articles:Tkinter: How to get a frame in the canvas window to expand the size of the canvas? - pythonHow to suppress console window while debugging python code in Python Tools for Visual Studio (PTVS)? - pythonWhich section disables objdump by default - linuxWhat is a spectrogram and how to set its parameters? - matlabNeed to remove ObjectID () from _id with Meteor - mongodbC ++ 11 variation patterns and std :: endl - c ++PayPal Sandbox Classic API Express Checkout Internal NVP Server Error (500) - phpGorilla cookie authentication website - cookiesConstant search - ruby ββ| fooobar.comHow to send an XMPP message when the sender is disconnected? - androidAll Articles