KohanaFramework3.xを使用しています。私のWebサーバーはApacheであり、サーバーで複数のWebサイトを管理しているため、仮想ホストを使用しています。
私のhttpd.confは次のようになります。
<VirtualHost *:80>
ServerName www.myPage1.com
ServerAlias myPage1.com
DocumentRoot /var/www/myPage1
</VirtualHost>
<VirtualHost *:80>
ServerName www.myPage2.com
ServerAlias myPage2.de
DocumentRoot /var/www/myPage2
</VirtualHost>
コハナでは、すべてのhttpリクエストは最初にindex.phpに移動する必要があります。すべてがindex.phpで始まるこれらの醜いURL(たとえば、www.myPage1.com / index.php / item / detail / itemId)が気に入らないため、完全に機能する次の.htaccessファイルを使用しました。
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
.htaccessファイルを使用せず、代わりにすべての書き換えロジックをhttpd.confファイルに入れたいと思います。以下は私に「400BadRequest」を与えます
<VirtualHost *:80>
RewriteEngine On
<Files .*>
Order Deny,Allow
Deny From All
</Files>
RewriteRule ^(?:aplication|modules|system)\b.* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT]
ServerName www.myPage2.com
ServerAlias myPage2.com
DocumentRoot /var/www/myPage2
</VirtualHost>
私は何が間違っているのですか?助けていただければ幸いです!