Navigation

Contactez-nous

Kitpages
17 rue de la Frise
38000 Grenoble
tel : 04 58 00 33 81

Par Philippe Le Van (twitter accountplv) Dernière mise à jour : 16 April 2014

Apache, redirection 301 de tout un site

Pourquoi rediriger un site entier ?

Concrètement, il m'est arrivé plusieurs fois qu'un client abandonne un site pour le réintégrer dans un autre site.

Là il veut faire disparaitre l'ancien site, mais il veut que ses liens entrants aillent vers un autre site lui appartenant.

Solution avec les Rewrite apache

Dans le virtual host concerné, dans le httpd.conf (ou équivalent suivant la distrib), j'ajoute la configuration suivante :

<VirtualHost *>
  ServerName mon-site-a-transferer.fr
  DocumentRoot /var/www/mon-site-a-transferer.fr/web
  <Location />
    RewriteEngine on
    RewriteRule .* http://www.mon-site-destination.fr [R=301,L]
  </Location>
</VirtualHost>

Commentaires

Ajouter un commentaire
Woah! I'm really digging thhe template/theme of this website.
It's simple, yet effective. A lot of times it's very difficult to 
get that "perfect balance" between usability and appearance.
I must sayy you have done a amazing job with this. Also,
the blog loads very quick for me on Opera. Superb Blog!