我想在一個子目錄中安裝最新版本的笨的。這工作到目前爲止。但現在我想從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