I am while using Kohana Framework 3.x. My Webserver is Apache and that i use Virtual Hosts, because I manage several websites with my Server.

My httpd.conf appears like this:

  <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>

In Kohana every http request needs to visit the index.php first. Because I dont such as these ugly Web addresses that begins with index.php (for instance www.myPage1.com/index.php/item/detail/itemId) I made use of the next .htaccess file which labored perfectly

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

I now would like to not make use of a .htaccess file any longer and rather invest the rewrite logic into my httpd.conf file. The next provides me with a "400 Bad Request"

<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>

What shall we be held doing wrong? Help could be appreciated!

You do not have a RewriteBase inside your httpd.conf. And wrong using the .htaccess?

can it be this typo (maybe it ought to be 'application') - RewriteRule ^(?:aplicationmodulessystem)b.* index.php/$ [L]

Remember, should you put these rules within the primary server conf file (usually httpd.conf) instead of an .htaccess file, you will need to use ^/... ... rather than ^... ... at the outset of the RewriteRule line, quite simply, give a slash.

take a look, might help.