Apache: Hôte Virtuel et la Réécriture d'URL à l'intérieur de httpd.conf pour Kohana Cadre

Je suis en utilisant le Framework Kohana 3.x. Mon Serveur web est Apache et j'utilise des Hôtes Virtuels, parce que je gère plus d'un des sites web avec mon Serveur.

Mon httpd.conf ressemble à ceci:

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

Dans Kohana chaque requête http besoins d'aller à la index.php d'abord. Parce que je n'aime pas ces vilaines Url qui commence par index.php (par exemple www.myPage1.com/index.php/item/detail/itemId) j'ai utilisé le suivant .fichier htaccess qui a parfaitement fonctionné

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

Je voudrais maintenant pour ne pas utiliser un .fichier htaccess plus et au lieu de mettre tous la réécriture logique dans mon httpd.fichier conf. La suite me donne un "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>

Ce que je fais mal? De l'aide serait apprécié!

InformationsquelleAutor Pascal Klein | 2010-11-30