PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > Apache and mod_rewrite question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Apache and mod_rewrite question

Réponse
 
LinkBack Outils de la discussion
Vieux 21/08/2006, 19h48   #1
syn_NOSPAM_uw
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Apache and mod_rewrite question

Hello,

I am stuck trying to make mod_rewrite work as I would like it to. I
quickly explain my case:

I have a virtualhost with the following directories in it's DocumentRoot:

- 2005
- 2006
- 2007

For each of these directories I have a different hostname which should
be associated to it, these are:

- year05.domain.tld
- year06.domain.tld
- year07.domain.tld

Now what I would like to do is mod_rewrite to rewrite the URL of
year05.domain.tld so that it goes to http://year05.domain.tld/2005 and
year06.domain.tld to go to http://year06.domain.tld/ and so on...

How can I acheive that in one single virtual host entry ?

Many thanks in advance for the

Regards
  Réponse avec citation
Vieux 22/08/2006, 19h00   #2
Bob Smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Apache and mod_rewrite question

On 8/21/2006 2:48 PM, syn_NOSPAM_uw wrote:
> I have a virtualhost with the following directories in it's DocumentRoot:
>
> - 2005
> - 2006
> - 2007
>
> For each of these directories I have a different hostname which should
> be associated to it, these are:
>
> - year05.domain.tld
> - year06.domain.tld
> - year07.domain.tld
>
> Now what I would like to do is mod_rewrite to rewrite the URL of
> year05.domain.tld so that it goes to http://year05.domain.tld/2005 and
> year06.domain.tld to go to http://year06.domain.tld/ and so on...
>
> How can I acheive that in one single virtual host entry ?


RewriteCond %{HTTP_HOST} ^year05\.domain\.tld$ [NC]
RewriteCond %{REQUEST_URI} !^/2005/
RewriteRule ^/(.*)$ /2005/$1 [L]

etc.

--
_________________________________________
Bob Smith -- bsmith@sudleydeplacespam.com

To reply to me directly, delete "despam".
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10146 seconds with 10 queries