Codeigniter无法删除index.php

编程入门 行业动态 更新时间:2024-10-22 15:33:25
本文介绍了Codeigniter无法删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我真的需要帮助,与标题相同,我的问题是无法删除我的codeigniter中的index.php

i really need help, same as the title, my problem is can't remove index.php in my codeigniter

我尝试了很多。 htaccess代码,例如:

i had try many .htaccess code like :

// first <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /projectFolderName/ --> i already change to my project name RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> //second <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> //third RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ – [NC,L] RewriteRule ^(.*)$ index.php/$1 [NC,L] //fouth RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]

我更改了配置,例如

$config['index_page'] = ''; $config['uri_protocol'] = 'REQUEST_URI';

在我的httd.conf中有一些引用

in some reference in my httd.conf

<Directory /> AllowOverride All Require all denied </Directory>

我将.htaccess移至主项目文件夹(不在应用程序中),但所有操作都没有't work

i move the .htaccess to main project folder (not in application) but all doesn't work

推荐答案

您忘记在<$ c中设置 base_url $ c> application / config / config.php 。设置您的 base_url 。

You forget to set base_url in application/config/config.php.Set your base_url.

$config['base_url'] = 'your_url';

在根文件夹 .htaccess中

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]

还有

$config['index_page'] = ''; $config['uri_protocol'] = 'REQUEST_URI';

在这里工作正常。

更多推荐

Codeigniter无法删除index.php

本文发布于:2023-10-31 18:51:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546969.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Codeigniter   index   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!