How to remove the index. php string from the website url developed by codeIgniter. If you use codeIgniter (CI) as a website friend, you will find that any url of the website will contain an index by default. php. from the SEO perspective, this has little impact on the website, but codeIgniter (CI) is used) A friend of the website should find that any url of the website will contain an index by default. php, from the SEO perspective, has little impact on the website, but it is very uncomfortable for the beauty of the url, next let's take a look at how to remove the index in the url of a website developed using codeIgniter. php.
Before performing the following operations, make sure that the environment on your website supports url rewriting using. htaccess. if you can, continue with the following operations:
Create a. htaccess file in the root directory of the website and enter the following content:
RewriteEngine onRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond $1 !^(index\\.php|images|css|js|robots\\.txt)RewriteRule ^(.*)$ /index.php/$1 [L]
The fourth line of the above code is to exclude some directories or files so that these directories will not be rewritten to index. php, which is generally used in external resources such as images, js, and css. That is to say, all non-PHP code should be excluded. (Here I excluded the css directory js directory and the robots.txt file from the images Directory. of course, index. php should also be excluded)
Find the application/config. php file, and set:
$config['index_page'] = "index.php";
Change
$config['index_page'] = "";
Articles you may be interested in
- How to remove ads on the dedeCMS background login page
- How does thinkphp remove index. php from the url?
- How to optimize website pages and increase webpage loading speed
- Summary of the JavaScript method for removing string spaces
- Thinkphp intercepts Chinese Strings
- Shoulder, back muscle group exercise-bring up-bend up rowing-move up-stand up weight bend up-sit posture neck pull down-bend upright hold up-neck front wide hold up
- Php bom removal tool, php batch removal of bom code
- Note the following when querying strings with single quotes and inserting strings with single quotes in Mysql:
A friend who works as a website by CI should find that any url of the website will contain an index by default. php, from the SEO perspective, has little impact on the website,...