When I re-access a framework, I must first remove the entry file, that is, index. php is not very beautiful in the url, and every time I access my website, it will be scored. when I re-access a framework, I must first remove the entry file, that is, index. php is not very beautiful on the url, and every time I access my website, I need to enter the url. This tells you how to remove the entry file in the CI framework, that is, to add a redirection operation. The operations on many frameworks are similar.
The words are turning ....
1.
LoadModule rewrite_module modules/mod_rewrite.so, remove the # before the row.
Search for AllowOverride None (there are multiple configuration files), view the comments, and change the row information of related. htaccess to AllowOverride All.
2. under the root directory of CI, that is, in index. php, system directory at the same level, create. htaccess, directly creating the file name will not succeed, you can first create a notepad file, save it as a file with this name. The content is as follows (this is also introduced in the CI manual ):
RewriteEngine on
RewriteCond $1! ^ (Index \. php | images | robots \. txt)
RewriteRule ^ (. *) $/index. php/$1 [L]
If the file is not in the root directory of www, for example, http: // localhost/CI/index. php/, the third line needs to be rewritten to RewriteRule ^ (. *) $/CI/index. php/$1 [L].
In addition, my index. php Directory has the js folder and css folder under the same level, which need to be filtered out, and the second line needs to be rewritten as: RewriteCond $1! ^ (Index \. php | images | js | css | robots \. txt ).
3. set the configuration file (system/application/config. $ config ['index _ page'] = "index. php "; set $ config ['index _ page'] = "";.
You can do this, but remember to start apache.
The preceding redirection rules can also be written as a. htacess file in linux. Put it in the root directory of the website.