Verfasst: 10.03.2005 15:47
soll heißen?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
#Forums
RewriteRule ^forum-([0-9]*)-([0-9]*)-([0-9]*).* index.php?f=$1&ppage=$2&sort=lastpost&order=DESC&start=$3
RewriteRule ^forum-([0-9]*)-([0-9]*).* index.php?f=$1&ppage=$2&sort=lastpost&order=DESC
RewriteRule ^mforum-([0-9]*).* index.php?f=$1&mark=topics
RewriteRule ^mforums.* index.php?mark=forums
RewriteRule ^forum-([0-9]*).* index.php?f=$1
RewriteRule ^forums.* index.php
RewriteRule ^intro.* intro.php
RewriteRule ^virus.* virus.php
RewriteRule ^downloads.* dload.php
#Topics
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewtopic.php\?t=$1&postdays=$2&postorder=asc&start=$3
RewriteRule ^poll-([0-9]*)-([0-9]*).* viewtopic.php\?t=$1&postdays=$2&postorder=asc&vote=viewresult
RewriteRule ^wtopic-([0-9]*).* viewtopic.php?t=$1&watch=topic&postorder=asc
RewriteRule ^utopic-([0-9]*).* viewtopic.php?t=$1&unwatch=topic&postorder=asc
RewriteRule ^topic-([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2
RewriteRule ^ptopic-([0-9]*).* viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic-([0-9]*).* viewtopic.php?t=$1&view=next
RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1
RewriteRule ^topic-([0-9]*).* viewtopic.php?t=$1
Code: Alles auswählen
// start short url's
if ( !$userdata['session_logged_in'] )
{
ob_start();
function replace_for_mod_rewrite(&$s) {
// get the correct base_url: protocoll,url,path to make sure to rewrite only internal links
if (empty($HTTP_SERVER_VARS['HTTP_HOST'])) {
$server = getenv('HTTP_HOST');
} else {
$server = $HTTP_SERVER_VARS['HTTP_HOST'];
}
// IIS sets HTTPS=off
if (isset($HTTP_SERVER_VARS['HTTPS']) && $HTTP_SERVER_VARS['HTTPS'] != 'off') {
$proto = 'https://';
} else {
$proto = 'http://';
}
// Get the name of this URI
// Start of with REQUEST_URI
if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) {
$path = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
$path = getenv('REQUEST_URI');
}
if ((empty($path)) || (substr($path, -1, 1) == '/')) {
// REQUEST_URI was empty or pointed to a path
// Try looking at PATH_INFO
$path = getenv('PATH_INFO');
if (empty($path)) {
// No luck there either
// Try SCRIPT_NAME
if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
$path = $HTTP_SERVER_VARS['SCRIPT_NAME'];
} else {
$path = getenv('SCRIPT_NAME');
}
}
}
$path = preg_replace('/[#\?].*/', '', $path);
$path = dirname($path);
if (preg_match('!^[/\\\]*$!', $path)) {
$path = '';
}
$base_url = "$proto$server$path/";
$prefix = '|"(?:'.$base_url.')?';
// now that we know about the correct $prefix we can start the rewriting
$urlin = array(
//Forums
"'(?<!/\./)index.php\?f=([0-9]*)&ppage=([0-9]*)&sort=lastpost&order=DESC&start=([0-9]*)'",
"'(?<!/\./)index.php\?f=([0-9]*)&ppage=([0-9]*)&sort=lastpost&order=DESC'",
"'(?<!/\./)index.php\?f=([0-9]*)&mark=topics'",
"'(?<!/\./)index.php\?mark=forums'",
"'(?<!/\./)index.php\?f=([0-9]*)'",
"'(?<!/\./)index.php'",
"'(?<!/\./)intro.php'",
"'(?<!/\./)virus.php'",
"'(?<!/\./)dload.php'",
//Topics
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=asc&start=([0-9]*)'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=asc&vote=viewresult'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&watch=topic&postorder=asc'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&unwatch=topic&postorder=asc'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&postorder=asc&start=([0-9]*)'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/\./)viewtopic.php\?p=([0-9]*)'",
"'(?<!/\./)viewtopic.php\?t=([0-9]*)'",
);
$urlout = array(
//Forums
"forum-\\1-\\2-\\3.html",
"forum-\\1-\\2.html",
"mforum-\\1.html",
"mforums.html",
"forum-\\1.html",
"forums.html",
"intro.html",
"virus.html",
"downloads.html",
//Topics
"topic-\\1-\\2-\\3.html",
"poll-\\1-\\2.html",
"wtopic-\\1.html",
"utopic-\\1.html",
"topic-\\1-\\2.html",
"topic-\\1-\\2.html",
"ptopic-\\1.html",
"ntopic-\\1.html",
"post-\\1.html",
"topic-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}
// end short url's
Code: Alles auswählen
//
// Short URL implementation
//
if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
}
Code: Alles auswählen
// short url's
$gzip_contents = replace_for_mod_rewrite($gzip_contents);
global $dbg_starttime;
Code: Alles auswählen
if ( $userdata['session_user_id'] != ANONYMOUS || $userdata['session_page'] == -4 ){
$SID = 'sid=' . $session_id;
} else {
$SID = '';
}
sonst hilft der ganze text drüber nix, da er ja nicht auf den prefix prüft, oder bin ich da jetzt am holzweg$prefix . '(?<!/)index.php"|',
ein update, welches mir entgangen ist. danke für den hinweis!larsneo hat geschrieben:um probleme bei der anzeige des captchas bei der registrierung zu vermeiden (falls nämlich die benutzer keine cookies erlauben) würde ich folgende zusätzliche änderung in der /includes/sessions.php vorschlagen (siehe originalmod):Code: Alles auswählen
if ( $userdata['session_user_id'] != ANONYMOUS || $userdata['session_page'] == -4 ){ $SID = 'sid=' . $session_id; } else { $SID = ''; }
Code: Alles auswählen
/viewtopic.php?printertopic=1&t=10&start=0&postdays=0&postorder=asc&vote=viewresult
Code: Alles auswählen
$prefix . '(?<!/)viewtopic.php\?printertopic=([0-9]*)&t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=asc&vote=viewresult"|',