j'utilise le rewriting sur mon serveur dans un fichier vhost.conf.
Il me permet de rediriger n'importe quel sousdomaine vers mon fichier web/index.php?site=variable
Le seul hic est que toutes les url sont redirigé
Par exemple :
http://monsoudomaine.mondomaine.com ----> web/index.php?site=monsousdomaine OK !
http://monsoudomaine.mondomaine.com/dossier -----> index.php?site=monsousdomaine Devrais pointer vers web/dossier
Voici mon code :
CODE
<IfModule mod_rewrite.c>
ServerAlias *.xxxxxxx.org
RewriteEngine on
RewriteMap lowercase int:tolower
# Not index.php requested
RewriteCond %{REQUEST_URI} !^/web/index.php
# Not www. requested
RewriteCond %{HTTP_HOST} !^www.xxxxxxx.org$
# subname present in request
RewriteCond %{HTTP_HOST} ^(.+).xxxxxxx.org
# Do the PROXY redirect to preserve the browser URL
RewriteRule . http://www.xxxxxxxx.org/web/index.php?site=%1
</IfModule>
ServerAlias *.xxxxxxx.org
RewriteEngine on
RewriteMap lowercase int:tolower
# Not index.php requested
RewriteCond %{REQUEST_URI} !^/web/index.php
# Not www. requested
RewriteCond %{HTTP_HOST} !^www.xxxxxxx.org$
# subname present in request
RewriteCond %{HTTP_HOST} ^(.+).xxxxxxx.org
# Do the PROXY redirect to preserve the browser URL
RewriteRule . http://www.xxxxxxxx.org/web/index.php?site=%1
</IfModule>
Merci beaucoup de m'aider car sur le rewriting j'y comprend pas grand chose !