Today learn codeigniter abbreviation CI first day, record learning experience.
CI China Https://codeigniter.org.cn/user_guide/general/urls.html?highlight=url Here is an introduction
Example. COM/class/function/ID
- The first paragraph represents the controller class to invoke;
- The second paragraph represents the function or method in the class to invoke;
- The third and subsequent segments represent the parameters passed to the controller, such as an ID or any other variable;
Removed fromindex.php in the URL
By default, your URL will contain the index.php file:
Example. COM/class/function/ID
1.
If your Apache server has mod_rewrite enabled, you can simply pass a . htaccess file (placed in the index.php sibling directory)
Plus some simple rules to remove the index.php. Here is an example of this file that uses a "negative condition" to exclude certain items that do not require redirection:
Rewriteengine Onrewritecond%{request_filename}!-frewritecond%{request_filename}!-dRewriteRule ^ (. *) $ index.php/$1 L
In the example above, other HTTP requests will go through your index.php file, in addition to the existing directories and files.
2.
httpd.conf Open LoadModule Rewrite_module modules/mod_rewrite.so If it is turned on, you can ignore it. 3. Restart Apache 4, application/config.php$config [' index_page '] = ' index.php '; --"index.php$config[' index_page ') = ';Http://192.168.1.89/welcome/index
PHP Framework Codeigniter--url Removal index.php