gpt4 book ai didi

.htaccess - 子目录中的 Codeigniter 安装

转载 作者:行者123 更新时间:2023-12-02 05:08:50 26 4
gpt4 key购买 nike

<分区>

我想在子目录中安装最新版本的 codeigniter。到目前为止有效。但现在我想从 url 中删除 index.php。因此,我在子文件夹中有这个 .htaccess 文件。

RewriteEngine On
RewriteBase /dev/

# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

###

# 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.*
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]

子文件夹的名称是 dev 并且 webroot(父文件夹)是空的。其中只有一个 index.html 文件。

所以这导致了这个结构:

/var/www/
index.html
dev/
ci installation here
.htaccess

当然 mod-rewrite 已启用。

知道为什么它不起作用吗?调用类似 http://domain.tld/dev/login 的内容时出现 404 错误

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