Я хочу установить последнюю версию codeigniter в подкаталог. Это работает до сих пор. Но теперь я хочу удалить index.php
с URL. Поэтому у меня есть этот файл .htaccess
в подпапках.Установка Codeigniter в подкаталоге
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
включена.
Любые идеи, почему это не сработает? Я получаю ошибку 404 при вызове чего-то вроде http://domain.tld/dev/login
В каком каталоге находится codeigniter index.php? – Pattle
Файл CI 'index.php' находится в' dev' с приложением и системной папкой –
Интересно, что он работает в корне document (после изменения 'RewriteBase' на'/'). –