Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无需在codeigniter中使用htaccess文件即可删除index.php的任何方法_Php_.htaccess_Codeigniter - Fatal编程技术网

无需在codeigniter中使用htaccess文件即可删除index.php的任何方法

无需在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

我正在尝试删除项目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 ^(.*)$ 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文件完成。