无需在codeigniter中使用htaccess文件即可删除index.php的任何方法
我正在尝试删除项目URL中的无需在codeigniter中使用htaccess文件即可删除index.php的任何方法,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我正在尝试删除项目URL中的index.php 我刚刚在htdocs中打开了CodeIgniter文件夹并粘贴了此代码 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule .* index.php/$0 [PT,L] #RewriteRule ^(.*)$ index.php/$0 [PT,L] RewriteRule ^(.*)$ inde
index.php
我刚刚在htdocs
中打开了CodeIgniter文件夹并粘贴了此代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule .* index.php/$0 [PT,L]
#RewriteRule ^(.*)$ index.php/$0 [PT,L]
RewriteRule ^(.*)$ index.php/$0 [QSA,L]
#RewriteRule ^(.*)$ index.php?/$1 [L]
#RewriteRule ^(.*)$ index.php/$1 [L]
根据,必须将以下代码添加到.htaccess文件中:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
不,这不是codeigniter函数,它是web服务器函数。它必须通过.htaccess文件完成。