gpt4 book ai didi

CodeIgniter - 删除 index.php

转载 作者:行者123 更新时间:2023-12-04 03:12:50 27 4
gpt4 key购买 nike

我在删除 CI 安装中的 index.php 时遇到了一些麻烦,我当前使用的 .htaccess 如下:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

我的 CI 安装从 public_html 目录返回,我已将配置更改为
$config['index_page'] = "";

所以我的 CI 如下所示
/core-1.7.3
/public_html/index.php

当我输入 url 时,我得到 404,但是当我将 index.php 放在它前面时,它工作正常:S

我糊涂了

最佳答案

你好
我已经安装了 1.7.3 并且这个 .htaccess 使用了这个 URL-

/CodeIgniter_1.7.3/public_html/welcome

.htaccess->
RewriteEngine On

RewriteCond $1 !^(index\.php|resources|robots\.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

关于CodeIgniter - 删除 index.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5203581/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com