Seite 1 von 2

Short URLs: z.B. f12/dies-ist-ein-titel-12345.htm

Verfasst: 29.12.2005 22:55
von Miroerr
Hallo,

habe in einem Forum eine solche Short URL gesehen (allerdings im vB):

http://www.xxxxxx.de/f11/info-irc-chat- ... -post.html

Gibt es so etwas auch für das phpBB ?

Verfasst: 29.12.2005 23:23
von Mario Siebert

Verfasst: 30.12.2005 00:23
von Miroerr
Dankeschön.
Liefert das eine bessere Indizierung als der Short-URL Mod von larsneo ?

Verfasst: 31.12.2005 18:39
von Miroerr
Der Mod ist leider nicht zu empfehlen, da sich die Queries verdoppeln oder verdreifachen! Außerdem verursacht er auch manchmal Fehler.

Verfasst: 05.01.2006 10:10
von mgutt
schau mal hier:
www.event-talk.de

ich habe eine gesäuberte version von 2lucky installiert.

Verfasst: 05.01.2006 10:17
von Markus Wandel
@mgutt

Hi,

wo kann man denn die Version von 2lucky bekommen ?

bye
Markus


PS. Gruß aus Köln nach Sankt Augustin

Verfasst: 05.01.2006 10:32
von mgutt
Download:
http://forum.2lucky.de/suma/suma-mod2011.rar

Anstatt die sessions von 2lucky, kannst du dann meine nehmen:
//
// Append $SID to a url. Borrowed from phplib and modified. This is an
// extra routine utilised by the session code above and acts as a wrapper
// around every single URL and form action. If you replace the session
// code you must include this routine, even if it's empty.
//
function areyouabot()
{

global $HTTP_SERVER_VARS;

$RobotsList = array (
"bot",
"spider",
"crawler",
"spyder",
"appie",
"architext",
"bjaaland",
"digout4u",
"echo",
"ferret",
"gulliver",
"harvest",
"htdig",
"ia_archiver",
"jeeves",
"linkwalker",
"lycos",
"mercator",
"moget",
"muscatferret",
"myweb",
"netcraft",
"nomad",
"petersnews",
"scooter",
"slurp",
"voila",
"voyager",
"webbase",
"weblayers",
"wget",
"ahoythehomepagefinder",
"alkaline",
"arachnophilia",
"aretha",
"ariadne",
"arks",
"aspider",
"atn.txt",
"atomz",
"auresys",
"backrub",
"bigbrother",
"blackwidow",
"blindekuh",
"bloodhound",
"brightnet",
"bspider",
"cassandra",
"cgireader",
"churl",
"cmc",
"collective",
"combine",
"core",
"cosmos",
"cruiser",
"cusco",
"deweb",
"digger",
"directhit",
"download_express",
"dwcp",
"e-collector",
"ebiness",
"eit",
"emacs",
"esther",
"evliyacelebi",
"nzexplorer",
"fdse",
"felix",
"fetchrover",
"fido",
"finnish",
"fireball",
"fouineur",
"francoroute",
"freecrawl",
"funnelweb",
"gama",
"gazz",
"gcreep",
"geturl",
"golem",
"grapnel",
"griffon",
"gromit",
"havindex",
"hometown",
"htmlgobble",
"hyperdecontextualizer",
"ibm",
"iconoclast",
"ilse",
"imagelock",
"incywincy",
"informant",
"infoseek",
"inspectorwww",
"intelliagent",
"iron33",
"israelisearch",
"javabee",
"jobo",
"jubii",
"jumpstation",
"katipo",
"kdd",
"kilroy",
"labelgrabber.txt",
"larbin",
"legs",
"linkidator",
"linkscan",
"lockon",
"logo_gif",
"macworm",
"magpie",
"marvin",
"mattie",
"mediafox",
"merzscope",
"meshexplorer",
"monster",
"motor",
"mwdsearch",
"netcarta",
"netmechanic",
"netscoop",
"newscan-online",
"nhse",
"northstar",
"occam",
"octopus",
"openfind",
"orb_search",
"packrat",
"pageboy",
"parasite",
"patric",
"pegasus",
"perignator",
"phantom",
"piltdownman",
"pimptrain",
"pioneer",
"pitkow",
"pka",
"plumtreewebaccessor",
"poppi",
"portalb",
"puu",
"python",
"raven",
"rbse",
"rhcs",
"roadrunner",
"robbie",
"robi",
"robofox",
"robozilla",
"rules",
"search_au",
"searchprocess",
"senrigan",
"sgscout",
"shaggy",
"shaihulud",
"sift",
"site-valet",
"sitegrabber",
"sitetech",
"snooper",
"spanner",
"speedy",
"spry",
"ssearcher",
"suke",
"suntek",
"sven",
"tach_bw",
"tarantula",
"templeton",
"teoma_agent1",
"titin",
"titan",
"tkwww",
"ucsd",
"udmsearch",
"urlck",
"valkyrie",
"victoria",
"visionsearch",
"w3index",
"w3m2",
"wallpaper",
"wanderer",
"webbandit",
"webcatcher",
"webcopy",
"webfetcher",
"webfoot",
"weblinker",
"webmirror",
"webmoose",
"webquest",
"webreader",
"webreaper",
"websnarf",
"webvac",
"webwalk",
"webwalker",
"webwatch",
"whatuseek",
"whowhere",
"wired-digital",
"wmir",
"wolp",
"wombat",
"worm",
"wwwc",
"wz101",
"xget",
"bobby",
"boris",
"bumblebee",
"ezresult",
"internetseer",
"justview",
"linkbot",
"linkchecker",
"nederland.zoek",
"perman",
"pompos",
"pooodle",
"redalert",
"shoutcast",
"slysearch",
"ultraseek",
"webcompass",
"yandex",
"crawl"
);

$botID = strtolower($HTTP_SERVER_VARS['HTTP_USER_AGENT']);
$iamabot = 0;
for ($i = 0; $i < count($RobotsList); $i++)
{

if ( stristr($botID, $RobotsList[$i]) )
{
$iamabot = 1;
return $iamabot;
}

}
return $iamabot;

}

function append_sid_suma($url, $non_html_amp = false)
{
global $SID,$HTTP_SERVER_VARS,$db;

// CONFIG: Umlaute ersetzen
$suma_search = array( 'Ö', 'Ä', 'Ü', 'ö', 'ä', 'à', 'é', 'è', 'ü', ' ', ".", "'", '#', '"', '&', '!', '?', '[', ']', '/', '>', '<', ";", ")", "(", ':', '&', ',', '+');
$suma_replace = array( 'oe', 'ae', 'ue', 'oe', 'ae', 'a', 'e', 'e', 'ue', '-', "-", "", '', '', 'und', '', '', '', '', '-', '', '', '', '', '', '', 'und', '', 'plus');

if (areyouabot() != 1) {
if( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
}

if( strstr($url,'viewtopic.php') && !strstr($url,'viewtopic.php?replace') )
{
if(ereg("#",$url)) {
$pos=strpos($url, "#");
$url_temp=substr($url,0,$pos);
$zusatz=substr($url,$pos,strlen($url));
$url=$url_temp;
}
else
{
$zusatz="";
}

$found=false;
$found_subject_topic=false;
$found_subject_forum=false;

if ( preg_match('#viewtopic.php\?t=#', $url) )
{
$highlight = preg_match('#highlight=#', $url);
$view = preg_match( '#view=#', $url);
$postdays = preg_match( '#postdays=#', $url);
$watch = preg_match( '#watch=#', $url);
$unwatch = preg_match( '#unwatch=#', $url);
$mode = preg_match( '#mode=#', $url);


if( !($highlight) && !($view) && !($postdays) && !($watch) && !($unwatch) && !($mode) )
{

$prg=str_replace("viewtopic.php?","",$url);
parse_str($prg, $prg_output);

$sql = "SELECT topic_title
FROM " . TOPICS_TABLE . "
WHERE topic_id = '".$prg_output['t']."'";
if ( !($result = $db->sql_query($sql)) )
{
#message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$found_subject_topic=true;
}

$url = str_replace( 'viewtopic.php', 'topic', $url );
$found=true;
}
elseif( $highlight && !($postdays) && !($watch) && !($unwatch) && !($mode))
{
$url = str_replace( 'viewtopic.php', 'htopic', $url );
$found=true;
}
elseif( $view )
{
$url = str_replace( 'viewtopic.php', 'vtopic', $url );
$found=true;
}
elseif( !$highlight )
{
$printertopic = preg_match('#printertopic=#', $url);
if( !($printertopic) )
{
$vote = preg_match('#vote=#', $url);
if( $postdays && !($vote) )
{
$url = str_replace( 'viewtopic.php', 'ltopic', $url );
$found=true;
}
elseif( $postdays && $vote )
{
$url = str_replace( 'viewtopic.php', 'utopic', $url );
$found=true;
}
}
elseif( $postdays && $printertopic )
{
$url = str_replace( 'viewtopic.php', 'prtopic', $url );
$found=true;
}
}
elseif( $postdays && $highlight )
{
$url = str_replace( 'viewtopic.php', 'lhtopic', $url );
$found=true;
}
}
elseif( preg_match('#viewtopic.php\?p=#', $url) )
{

$url = str_replace( 'viewtopic.php', 'ptopic', $url );
$found=true;
}

// ALT
//else
//{
// //nothing
// $url = str_replace( 'viewtopic.php', 'ptopic', $url );
// $found=true;
//}

if($found==true) {
$url = strtr($url,array("&t="=>"-","?t="=>"","?p="=>"","&"=>"","highlight="=>"-","view="=>"-","amp;"=>"","postorder="=>"-","start="=>"-","postdays="=>"-","sid="=>"-","ascvote="=>"-","vote="=>"-","setbm"=>"-"));
if ($found_subject_topic==true) $url.="--".urlencode(strtolower(str_replace($suma_search, $suma_replace, $row['topic_title'])));
$url .= '.htm'.$zusatz;
}
}


if( strstr ($url, 'viewforum.php?f=') )
{
$topicdays = preg_match('#topicdays=#', $url);

if( !preg_match('#mark=#', $url) && !($topicdays) )
{
$prg=str_replace("viewforum.php?","",$url);
parse_str($prg, $prg_output);

$sql = "SELECT forum_name
FROM " . FORUMS_TABLE . "
WHERE forum_id = '".$prg_output['f']."'";
if ( !($result = $db->sql_query($sql)) )
{
#message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$found_subject_forum=true;
}

$url = str_replace( 'viewforum.php', 'forum', $url );

}
elseif( $topicdays )
{
$url = str_replace( 'viewforum.php', 'pforum', $url );
}
else
{
$url = str_replace( 'viewforum.php', 'mforum', $url );
}
$url = strtr($url,array("?f="=>"","amp;"=>"","mark="=>"-","sid="=>"-","&"=>"","start="=>"-","topicdays="=>"-"));
if ($found_subject_forum==true) $url.="--".urlencode(strtolower(str_replace($suma_search, $suma_replace, $row['forum_name'])));
$url .= '.htm';
}

$url = ereg_replace('---','-',$url);
$url = ereg_replace('--','-',$url);
$url = ereg_replace('-.htm','.htm',$url);
return $url;
}


function append_sid_normal($url, $non_html_amp = false)
{
global $SID;
if (areyouabot($_SERVER["HTTP_USER_AGENT"], TRUE) != 1) {
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}}

return $url;
}

function append_sid($url, $non_html_amp = false)
{
$sumadebug=0;

if($sumadebug==1) {
return append_sid_normal($url, $non_html_amp);
}else{
return append_sid_suma($url, $non_html_amp);
}
}
mein .htaccess, falls du die auch brauchst:
DirectoryIndex index.php index.htm index.htm default.htm default.htm

Code: Alles auswählen

addType application/x-httpd-php .php .phtm .htm .htm

RewriteEngine On

# change all urls to www.evop.de
# RewriteCond %{HTTP_HOST} !^www\.evop\.de$
# RewriteRule ^(.*)$ http://www.evop.de/$1 [L,R=301]

# View Category 
RewriteCond %{REQUEST_URI} ^/vcat([0-9]*).htm*
RewriteRule ^(.*) /index.php?c=%1  [L] 

# View Forum 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1  [L] 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-(.*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1  [L] 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2  [L] 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*)-(.*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2  [L] 

RewriteCond %{REQUEST_URI} ^/pforum([0-9]*)-([0-9]*)-([0-9]*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3  [L] 

# View Forum 
RewriteCond %{REQUEST_URI} ^/mforum([0-9]*)-([a-zA-Z0-9]*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2  [L] 

# View Topic - after first page 
RewriteCond %{REQUEST_URI} ^/ltopic([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4  [L] 

# View Topic - after first page 
RewriteCond %{REQUEST_URI} ^/lhtopic([0-9]*)-([0-9]*)-([a-z]*)-(.*)([0-9?]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5  [L] 
RewriteCond %{REQUEST_URI} ^/lhtopic([0-9]*)-([0-9?]*)-([0-9]*)-([a-z]*)(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/stopic([0-9]*)-([0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1\#%2  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1  [L]
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*)-([^-]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2  [L]
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*)-([0-9]*)-([^-]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3  [L]

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/vtopic([0-9]*)-([a-zA-Z0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/ptopic([0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1\#%2  [L] 
RewriteCond %{REQUEST_URI} ^/ptopic([0-9]*)-([^-]*).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2\#%3  [L]

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/topic([0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-(.*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([0-9]*)-(.*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([0-9]*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2  [L] 

#vote result
RewriteCond %{REQUEST_URI} ^/utopic([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4  [L] 


#with session
#############

# View Forum 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2  [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3  [L] 
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([a-fA-F0-9]{32})-(.*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2  [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*)-([a-fA-F0-9]{32})-(.*).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3  [L] 

RewriteCond %{REQUEST_URI} ^/pforum([0-9]*)-([0-9]*)-([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3&sid=%4  [L] 

# View Forum 
RewriteCond %{REQUEST_URI} ^/mforum([0-9]*)-([a-zA-Z0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2&sid=%3  [L]  

# View Topic - after first page 
RewriteCond %{REQUEST_URI} ^/ltopic([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*)-([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4&sid=%5  [L] 

# View Topic - after first page
RewriteCond %{REQUEST_URI} ^/lhtopic([0-9]*)-([0-9]*)-([a-z]*)-([^-]*)-([0-9?]*)-([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5&sid=%6  [L] 
RewriteCond %{REQUEST_URI} ^/lhtopic([0-9]*)-([0-9?]*)-([0-9]*)-([a-z]*)-([^-]*)-([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&sid=%6  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/stopic([0-9]*)-([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2\#%3  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*)-([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%3  [L]
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*)-([^-]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2&sid=%3  [L] 
RewriteCond %{REQUEST_URI} ^/htopic([0-9]*)-([0-9]*)-([^-]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3&sid=%4  [L]

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/vtopic([0-9]*)-([a-zA-Z0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2&sid=%3  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/ptopic([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2\#%3  [L] 
RewriteCond %{REQUEST_URI} ^/ptopic([0-9]*)-([^-]*)-([[a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2&sid=%3\#%4  [L] 

# View Topic - normal
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([a-fA-F0-9]{32})-(.*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([0-9]*)-([a-fA-F0-9]{32}).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3  [L] 
RewriteCond %{REQUEST_URI} ^/topic([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-(.*).htm* 
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3  [L] 

#vote result
RewriteCond %{REQUEST_URI} ^/utopic([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([a-zA-Z0-9]*)-([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4&sid=%4  [L] 

Verfasst: 05.01.2006 11:20
von Miroerr
Ich werde den Mod von DogHoliday mal testen und dann berichten wie es mit den Queries aussieht.
Auch mit deiner Modif. sind es noch 255 Queries :(.

Verfasst: 05.01.2006 23:00
von rabbit
ein standard mod_rewrite sollte keine queries verursachen, da kein zugriff auf die DB erfolgt. alles wird server-seitig erledigt vom apache.
prüfe mal lieber deine verbauten MODs.

Verfasst: 05.01.2006 23:05
von Miroerr
Die Queries entstehen nur wenn ich den Keywords in URL Mod einbaue (auch die gefixte Version oben).