Interdire le référencement de certaines url

WRInaute accro
Re: Interdire le référencement de certaines urls

Je ferais ceci:
Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^meteoenfrance.com$ [NC]
RewriteRule (.*) http://www.meteoenfrance.com/$1 [QSA,R=301,L]

RedirectPermanent /meteo.php http://www.meteoenfrance.com/meteo.html
RedirectPermanent /long.php http://www.meteoenfrance.com/long-terme.html
RedirectPermanent /perturbation.php http://www.meteoenfrance.com/radar-pluies.html

RewriteRule ^meteo\.html$ /meteo.php [L]
RewriteRule ^long-terme\.html$ /long.php [L]
RewriteRule ^radar-pluies\.html$ /perturbation.php [L]
RewriteRule ^carte-vigilance\.html$ /vigilance.php [L]
RewriteRule ^direction-vents\.html$ /vent.php [L]
RewriteRule ^images-satellites\.html$ /satellite.php [L]
RewriteRule ^humidite\.html$ /humidite.php [L]
RewriteRule ^masse-air\.html$ /masse.php [L]
RewriteRule ^ephemeride\.html$ /ephemeride.php [L]
RewriteRule ^radar-foudre\.html$ /foudre.php [L]
RewriteRule ^records-climatique\.html$ /records.php [L]
RewriteRule ^dossiers-climatique\.html$ /dossiers.php [L]
RewriteRule ^horoscope\.html$ /horoscope.php [L]
RewriteRule ^webmaster\.html$ /webmaster.php [L]
RewriteRule ^itineraire\.html$ /itineraire.php [L]
RewriteRule ^webcam\.html$ /webmaster.php [L]
RewriteRule ^google-earth\.html$ /google.php [L]
RewriteRule ^dicton\.html$ /dicton.php [L]
RewriteRule ^phases-lune\.html$ /phases.php [L]
RewriteRule ^partenaires\.html$ /partenaires.php [L]
RewriteRule ^contact\.html$  /aide.php [L] 
RewriteRule ^remerciement\.html$  /remerciement.php [L] 
RewriteRule ^temperature\.html$  /temperature.php [L]
RewriteRule ^observations\.html$  /observations.php [L]

RewriteRule ^itineraire\.html$  /index.php?p=itineraire [L]
RewriteRule ^masse-air\.html$  /index.php?p=masse [L]
RewriteRule ^meteo\.html$  /index.php?p=meteo [L]
RewriteRule ^radar-pluies\.html$  /index.php?p=perturbation [L]
RewriteRule ^images-satellites\.html$  /index.php?p=satellite [L]

RewriteRule ^([a-zA-Z0-9_\-]+).html$ index.php?p=ville&v=$1  [L]
Je n'ai pas mis tous les RedirectPermanent. Il faut ajouter la liste complète.

Jean-Luc
 
WRInaute accro
Il a raison JL, ce 301 est vraiment de trop. Ca a du faire foirer la réindexation naturelle..
Si tes pages .php ne sont pas reindexés d'ici 3-4 jours, je te conseil de forcer avec un 301 la redirection dans le bon sens.
 
WRInaute impliqué
C'est normal l'erreur, ça boucle.

Pour chaque page il faut faire deux règles, comme ce qui suit:


Code:
RewriteRule radar-pluies\.html$ /index.php?stop&p=perturbation [L]

RewriteCond %{QUERY_STRING} ^p=perturbation$
RewriteRule index\.php http://www.meteoenfrance.com/radar-pluies.html? [R=301]

Le première règle fait afficher le contenu de index.php?p=perturbation quand on demande radar-pluies.html . L'adresse reste radar-pluies.html

La deuxième règle redirige l'adresse index.php?p=perturbation vers radar-pluies.html

Le parametre stop sert a éviter de boucler. Le ? a la fin de la deuxième règle sert a éviter de passer les paramètres a radar-pluies.html

Il faut enlever tous els redirect permanent, et toutes les autres règles.
 
Discussions similaires
Haut