Forum dédié au moteur de recherche et aux techniques d'optimisation par #taggle
Vous n'�tes pas identifi�.
Afin d'éviter le duplicate content, voici pour rappel quelques règles à inclure impérativement dans son .htaccess
A coller d'office sur tous vos sites.
#de example.com vers www.example.com/
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]
#anti-l'argoteur
RewriteCond %{REMOTE_ADDR} 85\.13\.194\.179
RewriteRule .* - [F]
#anti-proxymouse
RewriteCond %{REMOTE_ADDR} 67\.19\.211\.250
RewriteRule .* - [F]J'aimerais aussi rediriger index.php ou index.htm vers /
exemple : www.example.com/index.php --> www.example.com/
www.example.com/dossier/index.php --> www.example.com/dossier/
Comment qu'on peut faire ?
Hors ligne
Salut,
Renomme ton index en index_d.php puis dans le .htaccess mets
DirectoryIndex index_d.php
et tu peux alors rediriger index.php et index.html vers l'accueil avec le .htaccess:
RedirectPermanent /index.html http://www.example.com/
Si tu ne peux pas renommer index.php car tu t'en sers après en y collant des variables, fais une redirection dedans si aucune variable à toi ne passe:
if (empty($_GET['act']) && empty($_GET['id']){
header("Status: 301 Moved Permanently", false, 301);
header("Location: /");
exit();
}je suis quasiment sûr que ça marche, mais je n'ai pas testé alors je ne garantis rien ![]()
Derni�re modification par Phobos (08-04-2006 09:16:03)
Hors ligne
Je pensais que ce serait plus simple pour transformer tous les ./index.php en ./
Pourquoi est-tu obligé de changer de fichier par défaut ? Un problème de boucle infinie ??
Sinon, avez-vous d'autres éléments à rajouter ? d'autres proxies à zapper ?
Hors ligne
Oui Magicyoyo, en général ça fait une erreur 500
On peut ajouter d'autres ips ou des ua de bots, mais j'ai pas la liste là ![]()
Hors ligne
J'ai mis ça en plus dans les miens de htaccess
RewriteCond %{REMOTE_HOST} \.laurion\.net [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^Test [OR]
RewriteCond %{HTTP_USER_AGENT} ^Szukacz [OR]
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot [OR]
RewriteCond %{REMOTE_HOST} \.cn$ [OR]
Hors ligne
Merci Coyote !
Et après,tu mets la rewrite rule suivante ?
RewriteRule .* - [F]
Hors ligne
Si je repends :
#de example.com vers www.example.com/
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]
#anti proxies et aspirateurs de site
RewriteCond %{REMOTE_HOST} \.laurion\.net [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^Test [OR]
RewriteCond %{HTTP_USER_AGENT} ^Szukacz [OR]
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot [OR]
RewriteCond %{REMOTE_HOST} \.cn$ [OR]
RewriteCond %{REMOTE_ADDR} 85\.13\.194\.179
RewriteCond %{REMOTE_ADDR} 67\.19\.211\.250
RewriteRule .* - [F]La syntaxe des dernières lignes est-elle bonne ou faut-il que je rajoutes [OR] ?
Hors ligne
J'ai aussi l'anti spam referers donné par Sid à http://forum.taggle.org/viewtopic.php?id=1102
Hors ligne
OK, je rajoute :
#de example.com vers www.example.com/
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]
#anti proxies et aspirateurs de site
RewriteCond %{REMOTE_HOST} \.laurion\.net [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^Test [OR]
RewriteCond %{HTTP_USER_AGENT} ^Szukacz [OR]
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot [OR]
RewriteCond %{REMOTE_HOST} \.cn$ [OR]
RewriteCond %{REMOTE_ADDR} 85\.13\.194\.179
RewriteCond %{REMOTE_ADDR} 67\.19\.211\.250
RewriteRule .* - [F]
#anti spam de HTTP_REFERER
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)prohosting(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)poker(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)casino(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)sex(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)ringtones(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)viagra(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?valium-online.us.tf.*$ [NC]
RewriteRule \.*$ http://spam.abuse.net/ [R,L]Ca nous fait déjà une belle compilation. Si vous voyez d'autres trucs, n'hésitez pas à partager.
Hors ligne
Un conseil pour compacter un .htaccess :
http://www.toulouse-renaissance.net/c_o … ompact.htm afin de moins ralentir le site
Hors ligne
Excellent !
Merci.
Je potasse ça pour vous sortir une nouvelle version.
Hors ligne