我想在一个子目录中安装最新版本的笨的。这工作到目前为止。但现在我想从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
和根目录(父文件夹)是空的。其中只有一个index.html
文件。
因此,这是导致这种结构:
/var/www/
index.html
dev/
ci installation here
.htaccess
当然mod-rewrite
的和已启用。
任何想法,为什么它不会工作? 我拨打404错误时调用类似http://domain.tld/dev/login
什么目录是笨的index.php吗? – Pattle 2013-04-05 23:28:42
的CI'index.php'文件是'dev'with应用ANS系统文件夹 – 2013-04-06 07:49:22
有趣的是,它在文档根工作(改变'RewriteBase'到'/'后)。 – 2013-04-06 07:56:04