habe mir den Short URLs für phpBB2 (reloaded / RFC) eingebaut und bin aber noch nicht so wirklich damit zu frieden.
1. spidert Google die Seiten nicht wesentlich besser als vorher
2. sind die Links nicht immer im Short-URL-Stil, sondern oft auch noch im php-Stil.
Meine .htaccess sieht so aus:
Code: Alles auswählen
DirectoryIndex index.html index.htm index.php
RewriteEngine On
# prevent access from santy webworm a-e
RewriteCond %{QUERY_STRING} ^(.*)highlight=\%2527 [OR]
RewriteCond %{QUERY_STRING} ^(.*)rush=\%65\%63\%68 [OR]
RewriteCond %{QUERY_STRING} ^(.*)rush=echo [OR]
RewriteCond %{QUERY_STRING} ^(.*)wget\%20 [OR]
RewriteCond %{QUERY_STRING} ^(.*)cmd=
RewriteRule ^.*$ http://127.0.0.1/ [R,L]
# prevent pre php 4.3.10 bug
RewriteCond %{HTTP_COOKIE}% s:(.*):\%22test1\%22\%3b
RewriteRule ^.*$ http://127.0.0.1/ [R,L]
# prevent perl user agent (most often used by santy)
RewriteCond %{HTTP_USER_AGENT} ^lwp.* [NC]
RewriteRule ^.*$ http://127.0.0.1/ [R,L]
# extended rewriting only for .html [thx to Caterham]
RewriteRule !\.html$ - [L]
# Short URL implementation [larsneo]
RewriteCond %{REQUEST_URI} ^/forums\.html
RewriteRule (.*) /index.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/index-mark\.html
RewriteRule (.*) /index.php?mark=forums [L]
RewriteCond %{REQUEST_URI} ^/index\.html
RewriteRule (.*) /index.php [L]
RewriteCond %{REQUEST_URI} ^/category([0-9]*)\.html
RewriteRule (.*) /index.php?c=%1 [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*)-([0-9]*)\.html
RewriteRule (.*) /viewforum.php?f=%1&topicdays=%2&start=%3 [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-([0-9]*)\.html
RewriteRule (.*) /viewforum.php?f=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)-mark\.html
RewriteRule (.*) /viewforum.php?f=%1&mark=topics [L]
RewriteCond %{REQUEST_URI} ^/forum([0-9]*)\.html
RewriteRule (.*) /viewforum.php?f=%1 [L]
RewriteCond %{REQUEST_URI} ^/ptopic([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1&view=previous [L]
RewriteCond %{REQUEST_URI} ^/ntopic([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1&view=next [L]
RewriteCond %{REQUEST_URI} ^/ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*)-([a-zA-Z0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1&start=%2&postdays=%3&postorder=%4&highlight=%5 [L]
RewriteCond %{REQUEST_URI} ^/ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4 [L]
RewriteCond %{REQUEST_URI} ^/ftopic([0-9]*)-([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/ftopic([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?t=%1 [L]
RewriteCond %{REQUEST_URI} ^/fpost([0-9]*)\.html
RewriteRule (.*) /viewtopic.php?p=%1 [L]
RewriteCond %{REQUEST_URI} ^/post-newtopic-([0-9]*)\.html
RewriteRule (.*) /posting.php?mode=newtopic&f=%1 [L]
RewriteCond %{REQUEST_URI} ^/post-reply-([0-9]*)\.html
RewriteRule (.*) /posting.php?mode=reply&t=%1 [L]
RewriteCond %{REQUEST_URI} ^/post-([a-z]*)-([0-9]*)\.html
RewriteRule (.*) /posting.php?mode=%1&p=%2 [L]
RewriteCond %{REQUEST_URI} ^/album\.html
RewriteRule (.*) /album.php [L]
RewriteCond %{REQUEST_URI} ^/albumpic([0-9]*)-([a-z]*)\.html
RewriteRule (.*) /album_page.php?pic_id=%1&mode=%2 [L]
RewriteCond %{REQUEST_URI} ^/albumpic([0-9]*)\.html
RewriteRule (.*) /album_page.php?pic_id=%1 [L]
RewriteCond %{REQUEST_URI} ^/palbum\.html
RewriteRule (.*) /album_personal_index.php [L]
RewriteCond %{REQUEST_URI} ^/palbum([0-9]*)\.html
RewriteRule (.*) /album_personal.php?user_id=%1 [L]
RewriteCond %{REQUEST_URI} ^/profile([0-9]*)\.html
RewriteRule (.*) /profile.php\?mode=viewprofile&u=%1 [L]
RewriteCond %{REQUEST_URI} ^/search-author-(.*)\.html
RewriteRule (.*) /search.php\?search_author=%1 [L]
RewriteCond %{REQUEST_URI} ^/search-([0-9]*)-([0-9]*)\.html
RewriteRule (.*) /search.php\?search_id=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/search-([a-zA-Z]*)\.html
RewriteRule (.*) /search.php\?search_id=%1 [L]
RewriteCond %{REQUEST_URI} ^/privmsg-([a-zA-Z]*)-([0-9]*)\.html
RewriteRule (.*) /privmsg.php\?mode=%1&u=%2 [L]
RewriteCond %{REQUEST_URI} ^/privmsg-([a-zA-Z]*)\.html
RewriteRule (.*) /privmsg.php\?folder=%1 [L]
RewriteCond %{REQUEST_URI} ^/register\.html
RewriteRule (.*) /profile.php\?mode=register&agreed=true [L]
RewriteCond %{REQUEST_URI} ^/profile-([a-zA-Z0-9]*)\.html
RewriteRule (.*) /profile.php\?mode=%1 [L]
RewriteCond %{REQUEST_URI} ^/map-([0-9]*)\.html
RewriteRule (.*) /map.php\?highlight=%1 [L]
RewriteCond %{REQUEST_URI} ^/map\.html
RewriteRule (.*) /map.php [L]
RewriteCond %{REQUEST_URI} ^/faq\.html
RewriteRule (.*) /faq.php [L]
RewriteCond %{REQUEST_URI} ^/search\.html
RewriteRule (.*) /search.php [L]
RewriteCond %{REQUEST_URI} ^/memberlist\.html
RewriteRule (.*) /memberlist.php [L]
RewriteCond %{REQUEST_URI} ^/groups\.html
RewriteRule (.*) /groupcp.php [L]
RewriteCond %{REQUEST_URI} ^/report\.html
RewriteRule (.*) /report.php [L]
RewriteCond %{REQUEST_URI} ^/online\.html
RewriteRule (.*) /viewonline.php [L]
http://www.forum.schildkroeten-farm.de/page_header.txt
includes/page_teil sieht so aus:
Code: Alles auswählen
<?php
/***************************************************************************
* page_tail.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: page_tail.php,v 1.27.2.2 2002/11/26 11:42:12 psotfx Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
}
// Start add - Complete banner MOD
if ($banner_show_list)
{
$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't update banners data", "", __LINE__, __FILE__, $sql);
}
}
// End add - Complete banner MOD
//
// Show the overall footer.
//
include_once($phpbb_root_path . 'includes/functions_jr_admin.' . $phpEx);
$admin_link = jr_admin_make_admin_link();
$template->set_filenames(array(
'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
);
$template->assign_vars(array(
'PHPBB_VERSION' => '2' . $board_config['version'],
'AmazonBox' => $lang['AmazonBox'],
'amazonbox_limit' => $board_config['amazonbox_limit'],
'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
'PLUS_VERSION' => $plus_config['plus_version'],
'L_CREDITS' => $lang['Credits'],
'U_CREDITS' => append_sid("hacks_list.$phpEx"),
'ADMIN_LINK' => $admin_link)
);
// AMAZON BOX START
$amazonbox_limit = $board_config['amazonbox_limit'];
$sql = "SELECT word, replacement FROM " . AMAZONBOX_TABLE . " ORDER BY RAND() LIMIT " . $amazonbox_limit;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain amazonbox information', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$word = $row['word'];
$replacement = $row['replacement'];
$template->assign_block_vars("amazonbox", array(
'word' => $word,
'AmazonImg' => $replacement,
"AmazonLink" => "http://www.amazon.de/exec/obidos/ASIN/" . $replacement . "/" . $board_config['amazonbox_partnerid']
));
}
// AMAZON BOX END
$template->pparse('overall_footer');
//
// Close our DB connection.
//
$db->sql_close();
//
// Short URL implementation
//
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
//
// Short URL implementation
//
$gzip_contents = replace_for_mod_rewrite($gzip_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);
}
exit;
?>
Grüße
Dominik