- Home
- Categorie
- La Community Connect.gt
- Tutto sulla Community
- [phpBB] Topic title nell'url tramite mod_rewrite
-
@Giorgiotave said:
No.
Deve andare nella root del forum
cartellaforum/ > tuo file
Nella root principale questo file non c'è.
Devo andare ad aprire quello nella cartella cache, modificarlo aggiungendo all'inizio del file quelle righe e poi salvarlo nella root principale?
Oppure lo devo proprio andare a creare e metterci dentro solo ed esclusivamente quelle righe ?
-
@alive said:
Oppure lo devo proprio andare a creare e metterci dentro solo ed esclusivamente quelle righe ?
lo devi creare ...
-
Ok !
E per quell'altro problema ?
in page_header.php mi dice di trovare questo:
// // gzip_compression // $do_gzip_compress = FALSE; if($board_config['gzip_compress']) { $phpver = phpversion(); if($phpver >= "4.0.4pl1") { if(extension_loaded("zlib")) { if (headers_sent() != TRUE) { $gz_possible = isset($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) && eregi("gzip, deflate",$HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]); if ($gz_possible) ob_start("ob_gzhandler"); } } } else if($phpver > "4.0") { if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) { if(extension_loaded("zlib")) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); header("Content-Encoding: gzip"); } } } }
ma io invece nel file ho questo:
// // gzip_compression // $do_gzip_compress = FALSE; if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); $useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { if ( extension_loaded('zlib') ) { ob_start('ob_gzhandler'); } } else if ( $phpver > '4.0' ) { if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) { if ( extension_loaded('zlib') ) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); header('Content-Encoding: gzip'); } } } }
cosa devo fare?
-
@alive said:
cosa devo fare?
sicuramente una versione del MOD vecchiotta, sostituisci il codice che hai trovato
-
ok e per vedere se funziona tutto pefettamente ?
-
cosa ne dite di questo?
melgio o peggio ?############################################################## ## MOD Title: phpBB static URLs mod_rewrite 1.0.0 ## MOD Author: Craven de Kere (N/A) http://www.Able2Know.com ## MOD Description: This mod should be added AFTER the Able2Know.com SEO mod ## This mod makes static URLs (only for guests) for phpBB, for example topic-22234.html ## Please read the author notes BEFORE using this mod. ## Check http://www.able2know.com/forums/about15132.html ## for the latest version or to get help with this MOD ## ## MOD Version: 1.0.0 ## ## Installation Level: (Advanced) ## Installation Time: 5 Minutes ## Files To Edit: page_header.php, ## Included Files: n/a ############################################################## ## Author Notes: ## Use this mod together with the Able2Know.com SEO Mod (http://www.able2know.com/forums/about15132.html) ## Make backups and test this on a test forum if you can. This is not a typical mod. ## For an additional tutorial on preventing IP addresses from being logged see: ## http://www.able2know.com/forums/about22586.html ## ############################################################## ## MOD History: ## ## 2004-04-10 - Version 1.0.0 ## - Initial public release. ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/page_header.php # #-----[ FIND ]------------------------------------------ # // // Generate logged in/logged out status // # #-----[ AFTER, ADD ]------------------------------------------ # if ( !$userdata['session_logged_in'] ) { ob_start(); function replace_for_mod_rewrite(&$s) { $urlin = array( "'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'", "'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'", "'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'", "'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'", "'(?<!/)viewforum.php\?f=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)'", "'(?<!/)viewtopic.php&p=([0-9]*)'", "'(?<!/)viewtopic.php\?p=([0-9]*)'", ); $urlout = array( "topic-\\1-\\2-\\3.html", "mark-forum\\1.html", "updates-topic\\1.html", "stop-updates-topic\\1.html", "about\\1.html&highlight=\\2", "forum-\\1.html", "ptopic\\1.html", "ntopic\\1.html", "view-poll\\1-\\2-\\3.html", "about\\1-\\2-\\3-\\4.html", "about\\1.html", "about\\1-\\2.html", "about\\1.html", "post-\\1.html", "post-\\1.html", ); $s = preg_replace($urlin, $urlout, $s); return $s; } } # #-----[ OPEN ]------------------------------------------ # includes/page_tail.php # #-----[ FIND ]------------------------------------------ # $db->sql_close(); # #-----[ AFTER, ADD ]------------------------------------------ # if ( !$userdata['session_logged_in'] ) { $contents = ob_get_contents(); ob_end_clean(); echo replace_for_mod_rewrite($contents); global $dbg_starttime; } # #-----[ OPEN ]------------------------------------------ # .htaccess # #-----[ ADD ]------------------------------------------ # RewriteEngine On RewriteRule ^forums.* index.php [L,NC] RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC] RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC] RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC] RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC] RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC] RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC] RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC] RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC] RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC] RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC] RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC] RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC] RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC] RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC] RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC] RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC] RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC] # #-----[ OPEN ]------------------------------------------ # robots.txt Disallow: forums/post-*.html$ Disallow: forums/updates-topic.html*$ Disallow: forums/stop-updates-topic.html*$ Disallow: forums/ptopic*.html$ Disallow: forums/ntopic*.html$ # #-----[ OPEN ]------------------------------------------ # includes/functions.php # #-----[ FIND ]------------------------------------------ # if (!empty($db)) { $db->sql_close(); } # #-----[ AFTER, ADD ]------------------------------------------ # if ( !$userdata['session_logged_in'] ) { if (stristr($url, 'http://')) { header('Location: ' . $url); exit; } } # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM
-
@alive said:
ok e per vedere se funziona tutto pefettamente ?
Fai il backup di quei due file e poi uppi tutto sul server
-
non mi funziona mi da quest'errore
Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_tail.php on line 100 Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_tail.php on line 101 Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_tail.php on line 102 Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php on line 739 Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php on line 745 Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php on line 746
-
molto interessante
chi lo ha installato ha notato qualche differenza/miglioramento/peggioramento?
grazie
-
@alive said:
non mi funziona mi da quest'errore
Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_header.php:34) in /web/htdocs/www.clubmusiclovers.com/home/community/includes/page_tail.php on line 100
apri page_tail.php dovresti eliminare le righe vuote in testa al file
se non funziona ti spiego comunque l'errore
in soldoni la pagina php prova a modificare le impostazione dell'Header HTTP quando già parte della pagina è stata composta per essere inviata al Browser, spesso può essere semplicemente una riga vuota a creare il problema
-
in testa al file non ci sono righe vuote.
Ti posto la pg:
<?php /*************************************************************************** * page_tail.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : [email][email protected][/email] * * $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'); } // // CBACK.de CrackerTracker // Footer Parser and Counter // include($phpbb_root_path . 'ctracker/ct_footer.'.$phpEx); // // Show the overall footer. // $admin_link = ( $userdata['user_level'] == ADMIN ) ? '[url="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '"]' . $lang['Admin_panel'] . ' ' : ''; $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'], 'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 'ADMIN_LINK' => $admin_link) ); $template->pparse('overall_footer'); // // Close our DB connection. // $db->sql_close(); /* Un-comment the line below to restrict Admins only to view page generation info */ //if( ($userdata['session_logged_in']) and ($userdata['user_level'] == ADMIN) ) { $gzip_text = ($board_config['gzip_compress']) ? 'GZIP enabled' : 'GZIP disabled'; $debug_text = (DEBUG == 1) ? 'Debug on' : 'Debug off'; $excuted_queries = $db->num_queries; $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $gentime = round(($endtime - $starttime), 4); $sql_time = round($db->sql_time, 4); $sql_part = round($sql_time / $gentime * 100); $php_part = 100 - $sql_part; echo ' <div class="copyright" align="center">Page generation time: '. $gentime .'s (PHP: '. $php_part .'% - SQL: '. $sql_part .'%) - SQL queries: '. $excuted_queries .' - '. $gzip_text .' - '. $debug_text .'</div>'; } // // Compress buffered output if required and send to browser // // // begin keyword urls mod // header ('Expires: 0'); header ('Pragma: no-cache'); header ('X-Powered-By:'); header ('Server:'); if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1) { // $gzip_contents = preg_replace("/(\s+)?(\<.+\>)(\s+)?/", "$2", rewrite_urls(ob_get_contents())); $gzip_contents = rewrite_urls(ob_get_contents()); ob_end_clean(); header('Vary: Accept-Encoding'); Header('X-Content-Original-Length: ' . strlen($gzip_contents)); Header('X-Content-Encoded-By: webmedic page optimizer'); // $gzip_contents = preg_replace("//", "$2", $gzip_contents); // Header('X-Content-Clean-Rem-Length: ' . strlen($gzip_contents)); // $gzip_contents = preg_replace("/(\s+)?(\<.+\>)(\s+)?/", "$2", $gzip_contents); // $gzip_contents = preg_replace("/\\r|\\n|\\f/", "", $gzip_contents); // Header('X-Content-Clean-Space-Length: ' . strlen($gzip_contents)); // $gzip_contents = preg_replace("/(\S+)\x20{2,}(?=\S+)/", "$1 ", $gzip_contents); // Header('X-Content-Clean-Space-Inside-Length: ' . strlen($gzip_contents)); ob_start('ob_gzhandler'); echo $gzip_contents; ob_end_flush(); // header('Content-Length: '.ob_get_length()); ob_end_flush(); } else { // $contents = preg_replace("/(\s+)?(\<.+\>)(\s+)?/", "$2", ob_get_contents()); $contents = rewrite_urls(ob_get_contents()); ob_end_clean(); echo $contents; global $dbg_starttime; } // // end keyword urls mod // exit; ?>
-
aiutatemi pls !
-
vi siete dimenticati di me?
-
ma nessuno mi aiuta a far funzionare questa mod?
-
@alive said:
ma nessuno mi aiuta a far funzionare questa mod?
Guarda alive, neanche a me funziona, sono arrivato alla conclusione che ci sono alcune version di phpbb non compatibili.
L'ultima prova è copiare il codice che ha dato Tuonorosso, poi non ci resta che trovare un'altra mod
-
Quell'altra che avevo suggerito nell'altro post non va bene eh?
-
In giro ho trovato anche questa
mod: http://www.phpbbhacks.com/download.php?id=2207
demo: http://eric.best-1.biz/
cosa ne dite ?
Poi ho trovato anche questa cosa, non so se può essere interessante:
http://www.phpbb.com/kb/article.php?article_id=29 !
Fatemi sapere, voi esperti !
-
@Tuonorosso said:
Ciao ragazzi,
partendo da questo link http://www.computerbb.org/about2261.html ho trovato questo mods.Il fatto è che proprio non mi funziona. Le pagine mi rimangono sempre in .php?par=X invece che trasformarsi in xxxxx-vt-X.htm
Ecco il codice:
># #-----[ OPEN ]------------------------------------------ # includes/page_header.php # #-----[ FIND ]------------------------------------------ # $template->set_filenames(array( 'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl') ); # #-----[ AFTER, ADD ]------------------------------------------ # ob_start(); function make_url_friendly($url) { $url = strtolower($url); $find = array(' ', '&', '\r\n', '\n', '/', '\\', '+'); $url = str_replace ($find, '-', $url); $find = array(' ', 'é', 'è', 'ë', 'ê'); $url = str_replace ($find, 'e', $url); $find = array(' ', 'ó', 'ò', 'ô', 'ö'); $url = str_replace ($find, 'o', $url); $find = array(' ', 'á', 'à', 'â', 'ä'); $url = str_replace ($find, 'a', $url); $find = array(' ', 'í', 'ì', 'î', 'ï'); $url = str_replace ($find, 'i', $url); $find = array(' ', 'ú', 'ù', 'û', 'ü'); $url = str_replace ($find, 'u', $url); $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); $repl = array('', '-', ''); $url = preg_replace ($find, $repl, $url); return $url; } function rewrite_urls($content) { function if_query($amp) { if($amp != '') { return '?'; } } $url_in = array('/(?<!\/)viewforum.php\?f=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*? )<\/a>/e', '/(?<!\/)viewtopic.php\?p=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a> /e', '/(?<!\/)viewtopic.php\?t=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a> /e'); $url_out = array("make_url_friendly('\\6') . '-vf\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'", "make_url_friendly('\\6') . '-vp\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'", "make_url_friendly('\\6') . '-vt\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'"); $content = preg_replace($url_in, $url_out, $content); return $content; } # #-----[ OPEN ]------------------------------------------ # includes/page_tail.php # #-----[ FIND ]------------------------------------------ # if ( $do_gzip_compress ) { // // Borrowed from php.net! // $gzip_contents = ob_get_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); } # #-----[ REPLACE, WITH ]------------------------------------------ # if ( $do_gzip_compress ) { // // Borrowed from php.net! // $gzip_contents = ob_get_contents(); ob_end_clean(); echo rewrite_urls($contents); global $dbg_starttime; $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); } else { $contents = ob_get_contents(); ob_end_clean(); echo rewrite_urls($contents); global $dbg_starttime; } >``` .HTACCESS Options +FollowSymlinks
RewriteEngine On
#this may cause isues with subdirs and so I have not enabled it.
#RewriteBase /RewriteRule [.]-vf([0-9]) viewforum.php?%{QUERY_STRING}&f=$1
RewriteRule [.]-vp([0-9]) viewtopic.php?%{QUERY_STRING}&p=$1
RewriteRule [.]-vt([0-9]) viewtopic.php?%{QUERY_STRING}&t=$1I dubbi che mi sono venuti sono 2:
- Avevo dei mods in queste 2 pagine, allora ho provato anche con page_header e page_tail presi vergini ma non funziona lo stesso
- Forse il mio problema è che ho l'indirizzo con sottodominio http: //forum.recensiamo.it , ma anche qui, provando a digitare un indirizzo con finale .htm la pagina si vede. Il problema sembra dunque nella scrittura degli url in maniera corretta. (da qui che il .htaccess sia corretto)
Grazie a chiunque possa aiutarmi a comprendere il codice
PS: credo che il succo stia nel page_tail.phpHo applicato passo passo la modifica su un forum con template subsilver e senza altre mod rilevanti.
Non mi è cambiato nulla. I link mi appaiono ancora come viewtopic.php?
dove devo andare a modificare per far creare i link con in essi il titolo del topic
-
Un consiglio: ma perché, anziché perdere il sonno per cercare di far funzionare questi mod/hack per phpBB, non passate a un forum che abbia gli URL spider-friendly built-in? [url=http://www.simplemachines.org/]SMF è open-source, accessibile e mi pare che funzioni benissimo (potete vedere la 1.1 RC2 in azione sul [url=http://forum.joomla.org/]forum di Joomla.org).
-
chissá, probabilmente perché, come me, non l'avevano mai sentito nominare
certo che [url=http://www.simplemachines.org/about/features.php]la lista di features é abbastanza indicativa...