meta tag installed, adding mod rewrite

phpBB2 SEO Simple mod Rewrite support forum.
This mods performs a fully static URL rewriting for phpBB.
Simple and efficient.

Moderator: Moderators

meta tag installed, adding mod rewrite

Postby diabolic.bg » Tue Feb 05, 2008 5:34 pm

Hi !
I have a similar problem with .htaccess.
I have installed dynamic_meta_tagsV0-2-0 and Optimal_titlesV_1.0.0.
In phpbb_seo folder I already have phpbb_seo_class from dynamic_meta_tagsV0-2-0 mod. I make a new file:

[mod] Too much code[/mod]

Is it correct?
This is my .htaccess:
Code: Select all
# You could need to un-comment the following line
# Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
RewriteRule ^phpbb2/index\.html$ /phpbb2/index.php [QSA,L,NC]
# FORUM PROTECTION RULE
RewriteRule ^phpbb2/[a-z0-9_-]+/([^/]+\.html)$ /phpbb2/index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^phpbb2/cat([0-9]+)\.html$ /phpbb2/index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^phpbb2/forum([0-9]+)-([0-9]+)\.html$ /phpbb2/viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^phpbb2/forum([0-9]+)\.html$ /phpbb2/viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^phpbb2/topic([0-9]+)-([0-9]+)\.html$ /phpbb2/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^phpbb2/topic([0-9]+)\.html$ /phpbb2/viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^phpbb2/post([0-9]+)\.html$ /phpbb2/viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^phpbb2/member([0-9]+)\.html$ /phpbb2/profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################


My path is /htdocs/phpbb2/ (root/forum directory/). If I place .htaccess right in root folder, I receive Error 500. :shock:
If I place .htaccess in phpbb_seo folder or phpbb2/cashe/ I receive blank page.
I don't understand where I must place .htaccess.
In my root I have a few .htaccess files:

htdocs/forbidden/.htaccess
htdocs/xampp/.htaccess
htdocs/phpbb2/cashe/.htaccess and
htdocs/xampp/sqlite/.htaccess

Help me please!
Sorry for my mistakes but my english is not very good. :oops:
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Advertisement

Postby dcz » Wed Feb 06, 2008 9:39 pm

Your .htaccess should work in the htdocs/ dir.

About the meta tag, you need to do as if you installed the meta tag mod not in standalone mode, this only means that you need to take the original phpbb_seo_class.php file and add the code changes for this file from the meta tag mod, and you'll be done ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby diabolic.bg » Thu Feb 07, 2008 7:06 am

Thanks, dcz!
But I think you don't understand me. If I place .htaccess right in htdocs folder I get error 500:
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500

If I place .htaccess right in htdocs/xampp/ folder I get blank page ant don't canget URL.
Maybe I must correct something?
Need I to correct phpbb to phpbb2 in phpbb_seo_class file?
What is wrong? I don't understand. :oops:
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby SeO » Thu Feb 07, 2008 9:09 am

Make sure mod_rewrite is available on your wamp installation.

You do not need to change anything in phpbb_seo_class.php, you just need to make sure the meta tag adding are where they should in phpbb_seo_class.php.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby diabolic.bg » Thu Feb 07, 2008 10:16 am

Yes, I'm sure. The file phpbb_seo_class who I placed in my first post is in phpbb_seo folder but I think he isn't correspond with .htaccess file because it wrong placed.
If I place it in htdocs/xampp/.htaccess or htdocs/phpbb2/cashe/.htaccess, I get blank page and URLs are not changed.
If I don't place .htaccess, I again get blank page as I already said and URLs are not changed.

Tell me please where I must place .htaccess.

htdocs/forbidden/.htaccess
htdocs/xampp/.htaccess
htdocs/phpbb2/cashe/.htaccess and
htdocs/xampp/sqlite/.htaccess

In who folder is right place?
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby HB » Fri Feb 08, 2008 3:43 am

I use xampplite and the .htaccess goes in the htdocs directory. When in doubt, go to the httpd.conf file in the apache conf directory. Search for this:

Code: Select all
DocumentRoot "C:/xampplite/htdocs"


That's where the .htaccess should go. Make certain this line is not commented:

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


Also check this:

Code: Select all
<Directory "C:/xampplite/htdocs">
...
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

The AllowOverride All says .htaccess can change the parms set in httpd.conf.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1211
Joined: Mon Oct 16, 2006 2:25 am

Postby diabolic.bg » Fri Feb 08, 2008 6:47 am

Sorry it don't work too. My root is:
DocumentRoot "C:/xAmp/xampp/htdocs"

....

This was commented but I uncomment it:

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


This was that way:

Code: Select all
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All


Now my .htaccess is working right in htdocs/ dir but I get blank page on index.php. :cry:
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby SeO » Mon Feb 11, 2008 10:27 am

Try to activate phpBB debug in config.php (uncommenting the last two line) in case some useful error message shows up. If no message show up with debug, it's most likely a language pack issue, if so make sure you did all the required code change in the language packs.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby diabolic.bg » Mon Feb 11, 2008 10:48 am

Sorry, I don't understand. In my config.php isn't commented lines. :?

Code: Select all
<?php


// phpBB 2.x auto-generated config file
// Do not change anything in this file!

$dbms = 'mysql4';

$dbhost = 'xxxxx';
$dbname = 'xxxxx';
$dbuser = 'xxxxx';
$dbpasswd = 'xxxxx';

$table_prefix = 'phpbb_';

define('PHPBB_INSTALLED', true);

?>


Can I ask another question? I have tested
## MOD Title: phpBB static URLs mod_rewrite 1.0.0
## MOD Author: Craven de Kere.

It can works in my board.
Can it works with your Google Yahoo MSN Sitemaps and RSS (GYM) or will be make errors in maps?
Thanks in advance for the answer!
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby SeO » Tue Feb 12, 2008 9:27 am

Ouups, sorry, I got confused between phpBB2 and phpBB3 ;)

Then, since it's local, you should have access to php error logs somewhere, could give us some more info about what's going on.

A blank page still means that an error occurred with no message display (due to server settings).
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby diabolic.bg » Thu Feb 14, 2008 12:28 pm

I still don't find out why I gets blank page. In my logs I don't find nothing. :(
Any ideas? Help me, please!
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby diabolic.bg » Fri Feb 15, 2008 5:46 pm

After the success with gym sitemaps I have installed again Simple mod rewrite and again get blank page.

In my phpbb_seo_class file after mod rewrite codes I add codes from dynamic_meta_tagsV0-2-0 mod.
And in .htaccess file in my root/ dir add the codes for mod rewrite before gim_sitemaps codes.

Help please!
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby SeO » Sat Feb 16, 2008 9:12 am

diabolic.bg wrote:In my phpbb_seo_class file after mod rewrite codes I add codes from dynamic_meta_tagsV0-2-0 mod.


For the third (at least) time within three threads, do not add the full content of the standalone phpbb_seo.php meta tag file.

All you need to do within the mod_rewrite phpbb_seo.php file is :
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

phpbb_seo/phpbb_seo_class.php

#
#-----[ FIND ]------------------------------------------
#

   /**
   * constuctor
   */
   function phpbb_seo() {

#
#-----[ FIND ]------------------------------------------
#

      return;
   }
#
#-----[ BEFORE, ADD ]------------------------------------------
#

      // --> Meta tags
      $this->seo_meta_tags();

#
#-----[ FIND ]------------------------------------------
#

}
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

   // -- > 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 = 15) {
      $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' => 'en',
         'meta_cat' => 'general',
         'meta_robots' => 'index,follow',
         'meta_gened' => FALSE
      );
      return;
   }


Let's make sure about this first.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby diabolic.bg » Sat Feb 16, 2008 10:32 am

Thanks! I'm sure - my meta tags works and GYM works too, but here is my phpbb_seo_class as txt with GYM and Meta tags. Please, check it and tell me if I must correct something.

EDIT
In 16.15 GMT +2 I again try to start Simple rewrite mod and again get blank page. This is my log file from test:

[Sat Feb 16 15:43:58 2008] [error] [client 83.228.xxx.xxx] File does not exist: C:/xAmp/xampp/htdocs/phpbb2/templates/fiblack3d/images/cellpic_bkg.gif, referer: http://wasteland-bg.com/phpbb2/index.php
[Sat Feb 16 15:43:59 2008] [error] [client 83.228.xxx.xxx] File does not exist: C:/xAmp/xampp/htdocs/phpbb2/img1.gif, referer: http://wasteland-bg.com/phpbb2/index.php
[Sat Feb 16 15:44:12 2008] [error] [client 83.228.xxx.xxx] File does not exist: C:/xAmp/xampp/htdocs/phpbb2/templates/fiblack3d/images/cellpic_bkg.gif, referer: http://wasteland-bg.com/phpbb2/index.php
[Sat Feb 16 15:44:14 2008] [error] [client 83.228.xxx.xxx] File does not exist: C:/xAmp/xampp/htdocs/phpbb2/img1.gif, referer: http://wasteland-bg.com/phpbb2/index.php

Maybe it can help...

P.S. I cannot install mixed_mod_rewriteV0-2-4. In my board files have many differences. He is 2.0.18 patched to 2.0.22 and index.php is very different.
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Postby diabolic.bg » Wed Feb 20, 2008 9:24 am

Today is great day in my site's history!
Early this morning I have installed again Simple mod rewrite and now, after installing GYM sitemaps, I have a success. All mods (Simple mod rewrite, GYM sitemaps, Dynamic_meta_tagsV0-2-0, Optimal_titlesV_1.0.0 and Simple-Show-BotV0-0-2) now works together.

THANK YOU WISE BOYS :!: :D

P.S. Of course I have added phpBB SEO link in my overall_footer.
You are great!
diabolic.bg
PR0
PR0
 
Posts: 52
Joined: Mon Feb 04, 2008 4:48 pm
Location: Bulgaria

Next

Return to phpBB2 Simple mod rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest