Code: Alles auswählen
##############################################################
## MOD Title: phpBB URL Rewriting
## MOD Author: jeepie < 1@jeepie.com > (Kevin Wyas) http://www.jeepie.com/forums/
## MOD Description: Rewrites URLs for viewforum.php and viewtopic.php to be more friendly to search engine spiders.
## MOD Version: 0.1.3
##
## Installation Level: moderate
## Installation Time: 20 Minutes
## Files To Edit: includes/page_header.php,
## includes/page_tail.php,
## Included Files: .htaccess
##############################################################
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
##############################################################
## Author Note: This MOD uses the .htaccess file on Apache web
## servers. If you already have a .htaccess file in place, do
## not replace it, append to it the file provided. Also, you must
## have mod_gzip installed on the server AND activated in the phpBB
## admin console under:
## General Admin>Configuration>General Board Settings>Enable GZip Compression
##
## IMPORTANT: The .htaccess must be placed in the root directory
## for the website, not the forums.
##
## IMPORTANT: If your forums are in a directory other than "/forums",
## you must edit the .htaccess file to reflect the actual directory name
## or else you will get 404 errors.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$do_gzip_compress = FALSE;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$do_gzip_compress = TRUE;
#
#-----[ FIND ]------------------------------------------
#
'SITENAME' => $board_config['sitename'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ROOT_PATH' => "http://" . $_SERVER['HTTP_HOST'] . $board_config['script_path'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
</head>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<base href="{ROOT_PATH}">
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
$gzip_contents = ob_get_contents();
ob_end_clean();
#
#-----[ AFTER, ADD ]------------------------------------------
#
$rw_search[0] = "/(href=\"|url=|action=\")viewforum.php\?f=(\d+?)(&[a-zA-Z]*=[a-zA-Z0-9]+)*&start=(\d+)(&[a-zA-Z]*=[a-zA-Z0-9]+)*\"/";
$rw_replace[0] = "\\1http://$_SERVER[HTTP_HOST]/Forum\\2/\\4.html\\3\\5\"";
$rw_search[1] = "/(href=\"|url=|action=\")viewforum.php\?f=(\d+?)(&.*)*\"/";
$rw_replace[1] = "\\1http://$_SERVER[HTTP_HOST]/Forum\\2/0.html\\3\"";
$rw_search[2] = "/(href=\"|url=|action=\")viewtopic.php\?t=(\d+?)(&[a-zA-Z]+=[a-zA-Z0-9]+)*&start=(\d+?)(&[a-zA-Z]*=[a-zA-Z0-9]*)*\"/";
$rw_replace[2] = "\\1http://$_SERVER[HTTP_HOST]/View\\2/\\4.html\\3\\5\"";
$rw_search[3] = "/(href=\"|url=|action=\")viewtopic.php\?t=(\d+?)(&[a-zA-Z]*=[a-zA-Z0-9]+)*\"/";
$rw_replace[3] = "\\1http://$_SERVER[HTTP_HOST]/View\\2/0.html\\3\"";
$rw_search[4] = "/href=\"#top\"/";
$rw_replace[4] = "href=\"$_SERVER[REQUEST_URI]#top\"";
$gzip_contents = preg_replace($rw_search, $rw_replace, $gzip_contents);
#
#-----[ COPY ]------------------------------------------
#
copy .htaccess to /
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Alles auswählen
RewriteEngine On
#----Start rewrite code for phpBB------
RewriteBase /View(.*)/
RewriteRule ^View(.*)/$ /forums/viewtopic.php?t=$1 [L]
RewriteRule ^View(.*)/(.*)\.html(.*)$ /forums/viewtopic.php?t=$1&start=$2$3 [L]
RewriteBase /Forum(.*)/
RewriteRule ^Forum(.*)/$ /forums/viewforum.php?f=$1 [L]
RewriteRule ^Forum(.*)/(.*)\.html(.*) /forums/viewforum.php?f=$1&start=$2$3 [L]
#----End rewrite code for phpBB-------
Acid
Nun habe ich alles das gemacht. Mein Forum liegt in www.fouls.de/phpBB2/ nun weiß ich nicht was ich in den Codes umändern muss, habe in der htaccess jeweils die forums in phpBB2 umgeändert.
Dann hochgeladen und siehe da: Ohne die htaccess zeigt es als Link auch etwas an wie eben /hdhdh/hsdh.htm (So als beispiel) , jedoch kann es die Seite nicht öffnen, denn davor fehlt immer bei dem Link
das phpBB2/ als Ordner, also igrendwo fehlt das nich bei Überschreiben oder? Wo muss das noch hin, wenn ich dann die htaccess hochlade, dann funktioniert gar nix mehr! Kein Zugriff mehr auf die Seite!
Habe mich also ausgesperrt. Habe somit alles wiederin den urzustand rückgeführt!
Kann mir jemand helfen?!
Danke!
Grüße
Rainer