In my board I have installed some your mods:
- dynamic_meta_tagsV0-2-0
- Optimal_titlesV_1.0.0
- Simple-Show-BotV0-0-2
All are great mods and works very good. I tested simple_mod_rewriteV0-2-4 but with it I have a problems. I already write in another topic.
Now in my board working able2know mod_rewrite. Maybe it is important to say. His .htaccess is in phpbb/ dir.
Yesterday I installed GYM Sitemaps \with GYM_Sitemap_xml_pluginV0-2-0 and GYM_Sitemap_txt_pluginV0-2-0\ - all the files are in phpbb/ dir.
Where I must place xs_gym_xml.cfg and xs_gym_txt.cfg?
but again have a problem:
all my maps \sitemap, rss and urllist\ works as .php but don't works as .xml - I get Error 404.
I read many topics here but don't find out right answer.
My phpbb_seo_class.php is
- Code: Select all
<?php
/**
*
* @package phpBB SEO
* @version $Id: phpbb_seo_class.php,v 1.0 2006/12/09 13:48:48 dcz Exp $
* @copyright (c) 2006 dcz - www.phpbb-seo.com
* @license http://www.opensource.org/licenses/rpl.php RPL Public License
*
*/
/**
* phpBB_SEO Class
* www.phpBB-SEO.com
* @package Advanced phpBB SEO mod Rewrite
*/
class phpbb_seo {
/**
* constuctor
*/
function phpbb_seo() {
global $phpEx;
// URL Settings
$this->seo_url = array( 'cat' => 'cat',
'forum' => 'forum-',
'topic' => 'about',
'user' => 'member'
);
$this->seo_delim = array('cat' => '-vc',
'forum' => '-vf',
'topic' => '-vt',
'user' => '-u'
);
$this->seo_ext = array('cat' => '.html',
'forum' => '.html',
'topic' => '.html',
'user' => '.html'
);
$this->seo_static = array('cat' => 'cat',
'forum' => 'forum-',
'topic' => 'about',
'post' => 'post',
'user' => 'member',
'start' => '-',
'gz_ext' => '.gz',
'index' => ''
);
$this->modrtype = -1;
return;
// --> Meta tags
$this->seo_meta_tags();
return;
}
// -- > Meta tags
var $seo_meta = array();
/**
* Returns meta tag code
*/
function build_meta($page_title = '') {
$meta_desc = ( $this->seo_meta['meta_desc'] != '' ) ? $this->seo_meta['meta_desc'] : $this->seo_meta['meta_desc_def'];
$keywords = ( $this->seo_meta['keywords'] != '' ) ? $this->seo_meta['keywords'] : $this->seo_meta['meta_keywords_def'];
$title = ( $this->seo_meta['meta_title'] != '' ) ? $this->seo_meta['meta_title'] : $page_title;
return sprintf( $this->seo_meta['meta_tpl'], $title, $this->seo_meta['meta_lang'], $meta_desc, $keywords, $this->seo_meta['meta_cat'], $this->seo_meta['meta_robots'] );
}
/**
* Returns a word list separated by comas
* You might want tu use mb_strlen() instead of strlen()
* if you are using UTF-8 : mb_strlen($word, 'UTF-8')
* you can as well change the minimum word size here : if ( strlen($word) >= 3 ) {
* Possible Options :
* - $limit = 0 means no limit.
* By default, ' . and , are deleted.
*/
function make_keywords($text, $limit = 35) {
$keywords = '';
$num = 0;
$text = preg_replace(array("`[[:punct:]]+`", "`[\s]+`"), array(" ", " "), strip_tags($text) );
$text = explode(" ", $text);
// We take the most used words first
$text = array_count_values($text);
foreach ($text as $word => $count) {
if ( strlen($word) >= 3 ) {
$keywords .= ($keywords == '') ? $word : ',' . $word;
$num++;
if ( $limit > 0 && $num >= $limit ) {
break;
}
}
}
return $keywords;
}
/**
* Filter php/html tags and white spaces and returns htmlspecialchared string
*/
function meta_filter_txt($text) {
return htmlspecialchars(preg_replace("`[\s]+`", " ", strip_tags($text) ) );
}
/**
* Initialize meta tags
* @access private
*/
function seo_meta_tags() {
global $board_config;
$this->seo_meta = array('meta_tpl' => '<meta name="title" content="%s" />' . "\n" . '<meta name="description" lang="%s" content="%s" />' . "\n" . '<meta name="keywords" content="%s" />' . "\n" . '<meta name="category" content="%s" />' . "\n" . '<meta name="robots" content="%s" />'. "\n",
'meta_title' => '',
'meta_desc' => '',
'meta_keywords' => '',
// Here you can hard code a static default title, description and keywords
// As is, the mod will return information based on the phpbb config
'meta_title_def' => $this->meta_filter_txt($board_config['sitename']),
'meta_desc_def' => $this->meta_filter_txt($board_config['site_desc']),
'meta_keywords_def' => $this->make_keywords($board_config['site_desc']),
'meta_lang' => 'bg',
'meta_cat' => 'general',
'meta_robots' => 'index, follow',
'meta_gened' => FALSE
);
return;
}
// --> Gen stats
/**
* Returns microtime
* Borrowed from php.net
*/
function microtime_float() {
return array_sum(explode(' ', microtime()));
}
// --> URL rewriting functions <--
/**
* Prepare Titles for URL injection
* Replace by the function you'd prefer for different URL injection standards
*/
function format_url( $url, $type = 'topic' ) {
//Short url
$url = preg_replace("(\[.*\])U","",$url);
$find = array('"','&','<','>','\r\n','\n',);
$url = str_replace ($find, '-', $url);
$url = str_replace ('Я', 'ss', $url);
$url = str_replace (array('ц','Ц'), 'oe', $url);
$url = str_replace (array('д','Д'), 'ae', $url);
$url = str_replace (array('ь','Ь'), 'ue', $url);
$find = "АБВГЕабвгеТУФХШтуфхшИЙКЛийклЗзМНОПмнопЩЪЫщъыяСс";
$replace = "aaaaaaaaaaooooooooooeeeeeeeecciiiiiiiiuuuuuuynn";
$url = strtr($url,$find,$replace);
$url = preg_replace("`[^a-zA-Z0-9]`", "-", $url);
$url = preg_replace("`[-]+`", "-", $url);
$url = trim($url, '-');
$url = ( $url == "" ) ? $type : strtolower($url);
return $url;
}
}
?>
My .htaccess is in root dir:
- Code: Select all
# You could need to un-comment the following line
# Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# GYM SITEMAPS AND RSS REWRITE RULES #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################
# RSS main
RewriteRule ^phpbb2/rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /phpbb2/rss.php?$1&$2 [L]
# RSS forums
RewriteRule ^phpbb2/forums-rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /phpbb2/rss.php?forum&c&$1&$2 [L]
# RSS all
RewriteRule ^phpbb2/([a-zA-Z0-9_-]+)-rss([0-9]*)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /phpbb2/rss.php?$1=$2&$3&$4 [L]
# RSS forum topics
RewriteRule ^phpbb2/.+-rf([0-9]+)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /phpbb2/rss.php?forum=$1&$2&$3 [L]
# SitemapIndex
RewriteRule ^phpbb2/sitemaps\.(xml(\.gz)?)$ /phpbb2/sitemap.php [L]
# Sitemap modules
RewriteRule ^phpbb2/([a-zA-Z0-9_-]+)-sitemap\.(xml(\.gz)?)$ /phpbb2/sitemap.php?$1 [L]
# Forum Sitemaps
RewriteRule ^phpbb2/.+-gf([0-9]+)\.(xml(\.gz)?)$ /phpbb2/sitemap.php?forum=$1 [L]
# Yahoo! urllist.txt
RewriteRule ^phpbb2/urllist\.(txt(\.gz)?)$ /phpbb2/urllist.php [L]
#########################################################
# END GYM SITEMAPS AND RSS REWRITE RULES #
#########################################################
# SITEMAP SITE TXT
RewriteRule ^phpbb2/([a-zA-Z0-9_-]+)-gx\.(xml(\.gz)?)$ /phpbb2/sitemap.php?xml=$1 [L]
# SITEMAP SITE TXT
RewriteRule ^phpbb2/([a-zA-Z0-9_-]+)-gt\.(xml(\.gz)?)$ /phpbb2/sitemap.php?txt=$1 [L]
Also I correct my ggs_functions as says dcz here.
This is my sitemap_index.php.
I think my problem is in .htaccess file but I don't understand it.
Help me please!

English |
French

