
hilfe mir

Code: Alles auswählen
DirectoryIndex index.html portal.php index.php index.htm
ErrorDocument 404 /404.php
AddType image/x-icon .ico
Options FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} /forums.*
RewriteRule (.*) /index.php
RewriteCond %{REQUEST_FILENAME} /viewforum([0-9]*)-([0-9]*)-([0-9]*).*
RewriteRule (.*) /viewforum.php?f=%1&topicdays=%2&start=%3
RewriteCond %{REQUEST_FILENAME} /forum([0-9]*).*
RewriteRule (.*) /viewforum.php?f=%1
RewriteCond %{REQUEST_FILENAME} /ptopic([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1&view=previous
RewriteCond %{REQUEST_FILENAME} /ntopic([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1&view=next
RewriteCond %{REQUEST_FILENAME} /ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4
RewriteCond %{REQUEST_FILENAME} /ftopic([0-9]*)-([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1&start=%2
RewriteCond %{REQUEST_FILENAME} /ftopic([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1
RewriteCond %{REQUEST_FILENAME} /ftopic([0-9]*).*
RewriteRule (.*) /viewtopic.php?t=%1&start=%2&postdays=%3&postorder=%4&highlight=%5
hilft miradidas hat geschrieben:ja ok, dann so, aber du hast für die ältere version auch geholfenrabbit hat geschrieben:btw, categories hierarchy ist nicht gleich categories hierarchy...
es kommt auf die version an, und was ich gepostet habe, ist für CH 2.1.0 gedacht. ob und wie der code mit älteren versionen funktioniert, kann ich nicht sagen.
wie kriege ich das jetzt weg?
adidas hat geschrieben:komisch, wenn man jetzt bei mir im Forum links mit index.php gibt
z.b.
www.phpbb.de/index.php, wirds automatisch zu www.phpbb.de/forums.html (also man schreibt nen beitrag mit /index.php, sendet es ab, aber es macht /forums.html)
kann man das irgendwie wegkriegen? das nervt irgendwie
ein erweitertes rewriting (das allerdings derzeit noch in der testphase ist) findest du unter http://www.phpbb.de/viewtopic.php?t=74349 - die dortige .htaccess bzw. rewrite function wird dir sicherlich helfenLogical hat geschrieben: Nur besteht bei mir auch noch das Problem, dass die Links von den "letzten Beiträgen"(der Pfeil neben dem Datum) nicht umgewandelt werden.
nein. aber man kann es ja mal mit deiner version versuchen.larsneo hat geschrieben:@adidas: wird bei deiner version (du nutzt ja nicht die variante aus dem ursprungsposting) die $base_url in der /includes/page_header.php auch aus den enviroment angaben des servers zusammengebastelt?
Code: Alles auswählen
ob_start();
function replace_mod_rewrite($s)
{
Code: Alles auswählen
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
Code: Alles auswählen
$contents = ob_get_contents();
ob_end_clean();
echo replace_mod_rewrite($contents);
global $dbg_starttime;
Code: Alles auswählen
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
Code: Alles auswählen
echo replace_for_mod_rewrite($contents);
Code: Alles auswählen
$gzip_contents = replace_for_mod_rewrite($gzip_contents);
is das jetzt für mich???rabbit hat geschrieben:nein. aber man kann es ja mal mit deiner version versuchen.larsneo hat geschrieben:@adidas: wird bei deiner version (du nutzt ja nicht die variante aus dem ursprungsposting) die $base_url in der /includes/page_header.php auch aus den enviroment angaben des servers zusammengebastelt?werde das mal auf meinem test environment laufen lassen...
cave: nur für url_rewrite in verbindung mit CH 2.1.0!
suche (in page_header.php):und ersetze mit:Code: Alles auswählen
ob_start(); function replace_mod_rewrite($s) {
in page_tail.php suchen:Code: Alles auswählen
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
und ersetzen mit:Code: Alles auswählen
$contents = ob_get_contents(); ob_end_clean(); echo replace_mod_rewrite($contents); global $dbg_starttime;
suchen:Code: Alles auswählen
$contents = ob_get_contents(); ob_end_clean(); echo replace_for_mod_rewrite($contents);
ersetzen mit:Code: Alles auswählen
echo replace_for_mod_rewrite($contents);
Code: Alles auswählen
$gzip_contents = replace_for_mod_rewrite($gzip_contents);
ja.is das jetzt für mich???