不能';t从url中删除index.php
我正在使用CodeIgnitor 3.0.0。我已经阅读了许多关于同一问题的问题,但这两个问题对我都不起作用,目前htaccess代码取自CI文档(我也尝试了各种.htaccess代码,这里给出了不同的答案),并且还使用Rewritebase检查了代码。这是我的.htaccess文件不能';t从url中删除index.php,php,.htaccess,codeigniter-3,Php,.htaccess,Codeigniter 3,我正在使用CodeIgnitor 3.0.0。我已经阅读了许多关于同一问题的问题,但这两个问题对我都不起作用,目前htaccess代码取自CI文档(我也尝试了各种.htaccess代码,这里给出了不同的答案),并且还使用Rewritebase检查了代码。这是我的.htaccess文件 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
正如一些答案所建议的那样,我也多次检查了我的config.php文件
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
我还检查了我在Xampp中的write_模式是否也打开,它已经打开了
AllowOverride All
这和默认路线有什么关系吗
$route['default_controller'] = 'welcome';
如果需要任何其他文件,请告诉我。我已经花了一天的时间在这上面了,任何帮助都将不胜感激
谢谢在您的codeigniter中这样做
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /project_name/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
重新启动发动机
重写基础/项目名称/
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php?/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]
ErrorDocument 404/index.php
在codeigniter中执行此操作
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /project_name/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
重新启动发动机
重写基础/项目名称/
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php?/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]
ErrorDocument 404/index.php
我以前和现在都试过了,但结果是一样的:(它说Object not Found你是否更改了此部件RewriteBase/project\u name/?是的,不知道发生了什么事我也多次重新启动xampp我以前和现在都试过,但结果是一样的:(上面说找不到对象您是否更改了此部件RewriteBase/project_name/?是的,不知道发生了什么我也多次重新启动了xampp