Url rewriting et virtualhost
Bonjour à tous,
Je post ce message car je n'arrive pas à activer l'url rewriting avec mes virtualhosts.
Voici les étapes que j'ai fait lors de l'installation de wamp :
1 - installer wamp
2 - création d'un alias vers mon workspace dans le dossier alias en passant par wamp alias directories > add an alias
Code:
1 2 3 4 5 6 7 8 9
|
Alias /workspace/ "C:\Users\csw\workspace\PHP/"
<Directory "C:\Users\csw\workspace\PHP/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory> |
3 - création de virtualhost dans le repertoire alias manuellement
(fichier localhost.conf)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#####
## localhost
## DOMAINE principal
#####
NameVirtualHost localhost
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
<VirtualHost localhost>
DocumentRoot C:/wamp/www/
ServerName localhost
</VirtualHost> |
(fichier mvc.conf)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#####
## framework.dev
## DOMAINE de mvc
#####
NameVirtualHost mvc.dev
<Directory "C:/Users/csw/workspace/PHP/MVC">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
<VirtualHost mvc.dev>
DocumentRoot C:/Users/csw/workspace/PHP/MVC
ServerName mvc.dev
</VirtualHost> |
4 - Modification du fichier host de windows>system32>drivers>etc
Code:
1 2 3 4 5
|
127.0.0.1 localhost
::1 localhost
127.0.0.1 localhost
127.0.0.1 mvc.dev |
5 - création du fichier htacces à la racine de mon répertoire mvc : C:/Users/csw/workspace/PHP/MVC/.htacces
Code:
1 2 3 4
|
Options +FollowSymLinks
RewriteEngin on
RewriteRule ^([a-zA-Z0-9\-\_\/]*)$ ./index.php?p=$1 [L] |
6 - selection du module d'url rewriting dans Apache>Apache module>rewrite_module
7 - redémarrage de tous les services de wamp
8 - tentative d'accès à l'url : http://mvc.dev/test/essai
9 - réponse du serveur
Citation:
The requested URL /test/essai was not found on this server.
Ai-je oublié ou mal fait quelque chose ?
Merci à tous pour votre aide :).