Zamierzam w tym artykule opisać kilka czynności których wykonanie sprawi, że forum będzie bardziej przyjazne dla wyszukiwarek
Na początku dość oczywista rzecz którą są znaczniki meta
Kod:
#---[ OPEN ]---
templates/twoj_styl/overall_header.tpl
#---[ FIND ]---
<head>
#---[ AFTER ADD ]---
<meta name="Description" content="Tu podaj opis Twojej strony">
<meta name="Keywords" content="wyraz1, wyraz2, wyraz3...">
Oczywiście
'Tu podaj opis Twojej strony'
i
'wyraz1, wyraz2, wyraz3...'
zastępujemy swoimi

Możemy zamiast tego zainstalować Tego hacka który pozwala na zdefiniowanie tych znaczników w PA
Nie należy także przesadzać z ilością słów kluczowych i długością opisu. Poza tym powinny pasować do tematyki forum
---------------------------------------------------------------------------------
Następnym krokiem będzie zainstalowanie tzw. Session killera
który nie przydziela botom z listy SIDa
Kod:
#---[ OPEN ]---
includes/sessions.php
#---[ FIND ]---
function append_sid($url, $non_html_amp = false)
{
global $SID;
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#---[ REPLACE WITH ]---
function append_sid($url, $non_html_amp = false)
{
global $SID;
if ( !empty($SID) && !eregi('sid=', $url) && !areyouabot() )
{
if ( !empty($SID) && !eregi('sid=', $url) ) {
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
}
return($url);
}
function areyouabot()
{
global $HTTP_SERVER_VARS;
$RobotsList = array (
// polskie roboty
"szukacz",
"netoskop",
"gooru",
"webspider",
"onet",
"inktomi",
"netsprint",
//koniec polskich robotow
"antibot",
"appie",
"architext",
"bjaaland",
"digout4u",
"echo",
"fast-webcrawler",
"ferret",
"googlebot",
"gulliver",
"harvest",
"htdig",
"ia_archiver",
"jeeves",
"jennybot",
"linkwalker",
"lycos",
"mercator",
"moget",
"muscatferret",
"myweb",
"netcraft",
"nomad",
"petersnews",
"scooter",
"slurp",
"unlost_web_crawler",
"voila",
"voyager",
"webbase",
"weblayers",
"wget",
"wisenutbot",
"acme.spider",
"ahoythehomepagefinder",
"alkaline",
"arachnophilia",
"aretha",
"ariadne",
"arks",
"aspider",
"atn.txt",
"atomz",
"auresys",
"backrub",
"bigbrother",
"blackwidow",
"blindekuh",
"bloodhound",
"brightnet",
"bspider",
"cactvschemistryspider",
"cassandra",
"cgireader",
"checkbot",
"churl",
"cmc",
"collective",
"combine",
"conceptbot",
"coolbot",
"core",
"cosmos",
"cruiser",
"cusco",
"cyberspyder",
"deweb",
"dienstspider",
"digger",
"diibot",
"directhit",
"dnabot",
"download_express",
"dragonbot",
"dwcp",
"e-collector",
"ebiness",
"eit",
"elfinbot",
"emacs",
"emcspider",
"esther",
"evliyacelebi",
"nzexplorer",
"fdse",
"felix",
"fetchrover",
"fido",
"finnish",
"fireball",
"fouineur",
"francoroute",
"freecrawl",
"funnelweb",
"gama",
"gazz",
"gcreep",
"getbot",
"geturl",
"golem",
"grapnel",
"griffon",
"gromit",
"hambot",
"havindeks",
"hometown",
"htmlgobble",
"hyperdecontextualizer",
"iajabot",
"ibm",
"iconoclast",
"ilse",
"imagelock",
"incywincy",
"informant",
"infoseek",
"infoseeksidewinder",
"infospider",
"inspectorwww",
"intelliagent",
"irobot",
"iron33",
"israelisearch",
"javabee",
"jbot",
"jcrawler",
"jobo",
"jobot",
"joebot",
"jubii",
"jumpstation",
"katipo",
"kdd",
"kilroy",
"ko_yappo_robot",
"labelgrabber.txt",
"larbin",
"legs",
"linkidator",
"linkscan",
"lockon",
"logo_gif",
"macworm",
"magpie",
"marvin",
"mattie",
"mediafox",
"merzscope",
"meshexplorer",
"mindcrawler",
"momspider",
"monster",
"motor",
"msnbot",
"yahoo! slurp",
"mwdsearch",
"netcarta",
"netmechanic",
"netscoop",
"newscan-online",
"nhse",
"northstar",
"occam",
"octopus",
"openfind",
"orb_search",
"packrat",
"pageboy",
"parasite",
"patric",
"pegasus",
"perignator",
"perlcrawler",
"phantom",
"piltdownman",
"pimptrain",
"pioneer",
"pitkow",
"pjspider",
"pka",
"plumtreewebaccessor",
"poppi",
"portalb",
"puu",
"python",
"raven",
"rbse",
"resumerobot",
"rhcs",
"roadrunner",
"robbie",
"robi",
"robofox",
"robozilla",
"roverbot",
"rules",
"safetynetrobot",
"search_au",
"searchprocess",
"senrigan",
"sgscout",
"shaggy",
"shaihulud",
"sift",
"simbot",
"site-valet",
"sitegrabber",
"sitetech",
"slcrawler",
"smartspider",
"snooper",
"solbot",
"spanner",
"speedy",
"spider_monkey",
"spiderbot",
"spiderline",
"spiderman",
"spiderview",
"spry",
"ssearcher",
"suke",
"suntek",
"sven",
"tach_bw",
"tarantula",
"tarspider",
"techbot",
"templeton",
"teoma_agent1",
"titin",
"titan",
"tkwww",
"tlspider",
"ucsd",
"udmsearch",
"urlck",
"valkyrie",
"victoria",
"visionsearch",
"vwbot",
"w3indeks",
"w3m2",
"wallpaper",
"wanderer",
"wapspider",
"webbandit",
"webcatcher",
"webcopy",
"webfetcher",
"webfoot",
"weblinker",
"webmirror",
"webmoose",
"webquest",
"webreader",
"webreaper",
"websnarf",
"webspider",
"webvac",
"webwalk",
"webwalker",
"webwatch",
"whatuseek",
"whowhere",
"wired-digital",
"wmir",
"wolp",
"wombat",
"worm",
"wwwc",
"wz101",
"xget",
"awbot",
"bobby",
"boris",
"bumblebee",
"cscrawler",
"daviesbot",
"ezresult",
"gigabot",
"gnodspider",
"internetseer",
"justview",
"linkbot",
"linkchecker",
"nederland.zoek",
"perman",
"pompos",
"psbot",
"redalert",
"shoutcast",
"slysearch",
"ultraseek",
"webcompass",
"yandex",
"robot",
"crawl"
);
$botID = strtolower($HTTP_SERVER_VARS['HTTP_USER_AGENT']);
for ($i = 0; $i < count($RobotsList); $i++)
{
if ( strstr($botID, $RobotsList[$i]) )
{
return TRUE;
}
}
return FALSE;
}
---------------------------------------------------------------------------------
Tą czynność należy wykonać tylko jeżeli twój serwer obsłuje .htaaccess
Obecnie większość serwerów to obsługuje ale lepiej sprawdź

Ten hack zamienia adres forum z
http://adres.forum.pl/viewforum.php?f=1na
http://adres.forum.pl/nazwa_forum.htmli adres tematu z
http://adres.forum.pl/viewtopic.php?t=1na
http://adres.forum.pl/tytul_tematu.htmlco ułatwia botom w indeksacji i później wyszukującym

Kod:
##############################################################
## MOD Title: phpBB google keyword URLs 1.1.0
## MOD Author: webmedic (bah@webmedic.net) <Brook Hyumphrey> http://www.webmedic.net
## Original code from: http://www.webmasterbrain.com/forum/question-static-sef-urls-for-phpbb-vt34.php
## MOD Description: This mod makes static URLs for phpBB
## Please read the author notes BEFORE using this mod.
## Check http://www.webmedic.net/released-phpbb-google-keyword-urls-110-vt2577.html
## for the latest version or to get help with this MOD
##
## MOD Version: 1.1.0
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: (3)
## page_header.php,
## page_footer.php,
## .htaccess
## Included Files: n/a
##############################################################
## Author Notes:
## Use this mod together with the manage bots mod already included with integramod
## Make backups and test this on a test forum if you can. This is not a typical mod.
## This version is not like all the other mod rewrite and search engine optimization mods
## out there. It will make your urls into keword phrases. to do this it rewrites the url
## to look like the topic or forum title.
## To see this mod in action please goto:
## http://www.webmedic.net/indeks.php
##
##############################################################
## MOD History:
##
## 2004-11-03 - Version 1.1.0
## - Added replacements for /, \, and foriegn character sets.
##
## 2004-08-22 - Version 1.0.0
## - Initial public release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
ob_start();
function make_url_friendly($url)
{
$url = strtolower($url);
$find = array(' ',
'&',
'\r\n',
'\n',
'/',
'\\',
'+');
$url = str_replace ($find, '-', $url);
$find = array(' ',
'é',
'è',
'ë',
'ê');
$url = str_replace ($find, 'e', $url);
$find = array(' ',
'ó',
'ò',
'ô',
'ö');
$url = str_replace ($find, 'o', $url);
$find = array(' ',
'á',
'à',
'â',
'ä');
$url = str_replace ($find, 'a', $url);
$find = array(' ',
'í',
'ì',
'î',
'ï');
$url = str_replace ($find, 'i', $url);
$find = array(' ',
'ú',
'ù',
'û',
'ü');
$url = str_replace ($find, 'u', $url);
$find = array('/[^a-z0-9\-<>]/',
'/[\-]+/',
'/<[^>]*>/');
$repl = array('',
'-',
'');
$url = preg_replace ($find, $repl, $url);
return $url;
}
function rewrite_urls($content)
{
function if_query($amp)
{
if($amp != '')
{
return '?';
}
}
$url_in = array('/(?<!\/)viewforum.php\?f=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)viewtopic.php\?p=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)viewtopic.php\?t=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e');
$url_out = array("make_url_friendly('\\6') . '-vf\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vp\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vt\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'");
$content = preg_replace($url_in, $url_out, $content);
return $content;
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
ob_end_clean();
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
}
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
ob_end_clean();
echo rewrite_urls($contents);
global $dbg_starttime;
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
}
else
{
$contents = ob_get_contents();
ob_end_clean();
echo rewrite_urls($contents);
global $dbg_starttime;
}
#
#-----[ OPEN ]------------------------------------------
#
.htaccess
#
#-----[ ADD ]------------------------------------------
#
Options +FollowSymlinks
RewriteEngine On
#this may cause isues with subdirs and so I have not enabled it.
#RewriteBase /
RewriteRule [.]*-vf([0-9]*) viewforum.php?%{QUERY_STRING}&f=$1
RewriteRule [.]*-vp([0-9]*) viewtopic.php?%{QUERY_STRING}&p=$1
RewriteRule [.]*-vt([0-9]*) viewtopic.php?%{QUERY_STRING}&t=$1
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
Dlatego lepiej 'poprawnie' nazywać tematy żeby szukający łatwiej znalazł to czego szuka

---------------------------------------------------------------------------------
(Jak narazie Razz) Ostatnim krokiem jest zainstalowanie tej modyfikacji która tworzy na oddzielnej stronie liste wszystkich tematów co także ułatwia zindeksowanie forum

----------------------------------------------------------------------------------
To właściwie mały dodatek znaleziony na forum.optymalizacja.com
w common.php przed ?> daj
Kod:
$robot=array("firefox", "analyzer", "arena.pl", "arachnofilia", "aspseek", "check", "crawl", "googlebot", "google", "bot", "gooru", "infoseek", "inktomi", "lycos", "msnbot", "netoskop", "NetSprint", "openfind", "onet", "roamer", "robot", "rover", "robozilla", "scooter", "search", "siphon", "siphon", "slurp", "spider", "sweep", "szukaj", "szukacz", "walker", "WebStripper", "webspider", "wisenutbot", "gulliver", "validator", "yandex", "ask jeeves", "moget@", "teomaagent", "infoNavirobot", "PPhpDig", "gigabaz", "Webclipping.com", "RRC", "netmechanic", "yahoo! slurp", "yandex",);
$file="bot.txt";
$openlogs=fopen("$file", "a");
$cnt = count($robot); # raz obliczamy ilosc elementow w tablicy, niepotrzebnie robiles to za kazda kolejna iteracja
for($i=0; $i < $cnt; $i++)
{
if(eregi($robot[$i], $_SERVER['HTTP_USER_AGENT']))
{
$content=date("r") . " | Wyszukiwarka: " . $robot[$i] . " (" . $_SERVER['HTTP_USER_AGENT'] . ") | IP: " .$_SERVER['REMOTE_ADDR']."\r\n";
if($openlogs && flock($openlogs,LOCK_EX)) { # sprawdzamy czy mamy uchwyt do pliku i jesli mamy to zakladamy blokade
fwrite($openlogs, $content);
flock($openlogs, LOCK_UN); #po wszystkim blokade zdejmujemy
} else {
die('nie udalo siem'); #konczymy dzialanie jesli plik nie zostal otwarty lub jesli nie mozna bylo zalozyc blokady
}
break;
}
}
fclose($openlogs); # zamykamy plik po zakonczeniu iteracji tablicy
Jeśli nasze forum odwiedzi jakiś bot to zapisuje to do pliku bot.txt

------------------------------------------------------------------------------------
Należy też stworzyć plik robots.txt i umieścić w katalogu głównym bo zawsze roboty odwołują się do tego pliku.
Kod:
User-agent: *
Disallow:
Ten kod pozwala wszystkim wyszukiwarkom wchodzić na wszystkie strony
Natomiast ten kod:
Kod:
User-agent: *
Disallow: /
Zabrania wszystkim wyszukiwarkom wchodzenia na jakąkolwiek strone

Możemy także zezwolić tylko np. googlebotom wchodzenia na nasze forum
Kod:
User-agent: googlebot
Disallow:
User-agent: *
Disallow: /
Możemy także zabronić botom wchodzenia do konkretnych plików/folderów
Kod:
User-agent: *
Disallow: /admin/
Disallow: privmsg.php
Co zabroni im wchodzenia do katalogu admin (chociaż i tak wyskoczy im błąd, że nie mają zezwoleń, ale tak przynajmniej nie będzie "wadliwych" stron w wyszukiwarkach

) i prywatnych wiadomości gdyż jak ktoś tu na forum pokazywał google je także indexuje
Jak macie jakieś pytania, propozycje lub wątpliwości to piszcie
Wymiana linków - Wypozycjonuj za darmo swoją strone!
Uwagi moderatora nilhir (dodane 17 Lis 2005, 15:03):
Ostatnio edytowany przez nilhir 17 Lis 2005, 15:03, edytowano w sumie 2 razy