Réduire
Brouillon
0
01/03/2013
0
Sous domaine en local avec Wamp
Mots-clés:
Web
1. Menu Wamp / Apache / Apache modules / cocher vhost_alias_module
2. Remplacer le contenu du fichier C:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf par:
      NameVirtualHost *:80
      <VirtualHost *:80>
         ServerName localhost.com
         ServerAlias www.localhost.com
         DocumentRoot "C:\wamp\www"
         ErrorLog "logs\errors.log"
         <directory "C:\wamp\www">
            Options Indexes FollowSymLinks
            AllowOverride all
            Order Deny,Allow
            Deny from all
            Allow from all
         </directory>
      </VirtualHost>
      <VirtualHost *:80>
         ServerName localhost.com
         ServerAlias *.localhost.com
         VirtualDocumentRoot C:\wamp\www\subdomains\%1
         ErrorLog "logs\errors.log"
         <directory "C:\wamp\www\subdomains\%1">
            Options Indexes FollowSymLinks
            AllowOverride all
            Order Deny,Allow
            Deny from all
            Allow from all
         </directory>
      </VirtualHost>
3. Modifier C:\Windows\System32\drivers\etc\hosts (démarrer notepad en mode administrateur (click droit sur notepad / Exécuter en tant qu'administrateur) et ajouter les lignes suivantes selon les sous-domaines que l'on veut utiliser:
      127.0.0.1       localhost.com
      127.0.0.1       www.localhost.com
      127.0.0.1       example.localhost.com
      127.0.0.1       example2.localhost.com
      127.0.0.1       mysubdomain.localhost.com