phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
[0.2.2 to 0.2.4] question

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Advanced mod Rewrite
::  
Author Message
hvactechforum



Joined: 03 Mar 2007
Posts: 44

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 1:34 am    Post subject: [0.2.2 to 0.2.4] question

I want to make sure to edit my .htaccess file correctly, could you please show me which "." need to be replaced and which "[QSA,L]" need a ,NC added...? Also, if you notice any errors in this file please let me know.

Code:
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^hvacruniverse\.com$ [NC]
RewriteRule ^(.*) http://www.hvacruniverse.com/$1 [QSA,L,R=301]

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


Joined: 28 Apr 2006
Posts: 14403

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 9:35 am    Post subject: Re: [0.2.2 to 0.2.4] question

As said, it's easier to do than to explain, but the principle is really what's said in the install, you need to replace all [QSA,L] with [QSA,L,NC], and the ^. (there is one per line) with ^[a-z0-9_-].

Since you do not use a path and this is the default root install .htaccess, I suggest you just use the one provided in the contrib folder :

Code:
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^hvacruniverse\.com$ [NC]
RewriteRule ^(.*) http://www.hvacruniverse.com/$1 [QSA,L,R=301]

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


++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
hvactechforum



Joined: 03 Mar 2007
Posts: 44

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 11:04 am    Post subject: Re: [0.2.2 to 0.2.4] question

Thank you for your reply.

I installed the upgrade from 0.2.2 to 0.2.4 and now I am receiving this error message:

Code:

Fatal error: Cannot redeclare class phpbb_seo in /home/content/h/v/a/blahblah/html/blahblah/phpbb_seo/phpbb_seo_class.php on line 16


Do you know what I have done wrong?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14403

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 11:06 am    Post subject: Re: [0.2.2 to 0.2.4] question

Looks like there is some duplicate code in phpbb_seo_class.php.

Check out the change you've done to this file, they are not many, should not be hard to figure out what went wrong.

You can as well re-mod the file from scratch, it's really a small update on this one.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
hvactechforum



Joined: 03 Mar 2007
Posts: 44

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 11:16 am    Post subject: Re: [0.2.2 to 0.2.4] question

dcz wrote:
You can as well re-mod the file from scratch, it's really a small update on this one.

Could you post the small update so I can remod this file from scratch please? Smile
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14403

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 11:18 am    Post subject: Re: [0.2.2 to 0.2.4] question

Well, as told in contrib/0.2.2_0.2.4_Advanced_Update.txt :

Code:
#
#-----[ OPEN ]------------------------------------------
#


phpbb_seo/phpbb_seo_class.php


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

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


#
#-----[ BEFORE, ADD ]------------------------------------------
#
   var   $seo_opt = array();
   var   $encoding = "iso-8859-1";

#
#-----[ FIND ]------------------------------------------
#
   function phpbb_seo() {
      global $phpEx, $board_config;
      // config
#
#-----[ DIY INSTRUCTIONS ]--------------------------------------------------
#

Don't forget you need to set up here your char-set in case your forum is not using iso-8859-1

#
#-----[ AFTER, ADD ]------------------------------------------
#

      $this->encoding = "iso-8859-1";

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

      $this->seo_path['phpbb_url'] = $this->seo_path['root_url'] . $this->seo_path['phpbb_script'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

      // Populate the $seo_path['PathToUrl'] array for multifolder setups handling.
      // Pattern is $this->seo_path['PathToUrl']['phpbb/'] = "http://www.example.com/phpbb/";
      $this->seo_path['PathToUrl'][$this->seo_path['phpbb_script']] = $this->seo_path['phpbb_url'];

#
#-----[ FIND ]------------------------------------------
#
      $this->seo_url = array( 'cat' =>  array(),
         'forum' =>  array(),
         'topic' =>  array(),
         'user' => 'member'
      );
#
#-----[ REPLACE WITH ]------------------------------------------
#
      $this->seo_url = array( 'cat' =>  array(),
         'forum' =>  array(),
         'topic' =>  array(),
         'user' =>  array()
      );
#
#-----[ FIND ]------------------------------------------
#

      if ($board_config['default_lang'] === 'french') {
         $this->seo_url['user'] = $this->seo_static['user'] = 'membre';
      }
#
#-----[ REPLACE WITH ]------------------------------------------
#

      if ($board_config['default_lang'] === 'french') {
         $this->seo_static['user'] = 'membre';
      }

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

   function format_url( $url, $type = 'topic' ) {
      $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 = strtolower($url);
      $url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
      $url = preg_replace("`([\-])+`", "\\1", $url);
      $url = trim($url, '-');
      $url = ( $url == "" ) ? $type : $url;
      return $url;
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#

   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace("`\[.*\]`U","",$url);
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url= htmlentities($url, ENT_COMPAT, $this->encoding);
      $url= preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $url );
      $url = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $url);
      $url = ( $url == "" ) ? $type : strtolower(trim($url, '-'));
      return $url;
   }

#
#-----[ DIY INSTRUCTIONS ]--------------------------------------------------
#

It is possible that you'll have here to find a slightly different piece of code, in case you
installed the mx sitemaps links fix.
If so, you'll need to find :

      $this->path = (!empty($this->path)) ? ( ( $this->path . '/' == $this->seo_path['phpbb_script']) ? $this->seo_path['phpbb_url'] : $this->path . '/' ) : '';

instead of the next FIND.

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

      $this->path = (!empty($this->path)) ? $this->path . '/' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#

      $this->path = (!empty($this->path)) ? ( isset( $this->seo_path['PathToUrl'][$this->path . '/'] ) ? $this->seo_path['PathToUrl'][$this->path . '/'] : $this->path . '/' ) : '';


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
hvactechforum



Joined: 03 Mar 2007
Posts: 44

[0.2.2 to 0.2.4] questionPosted: Sat May 05, 2007 11:43 am    Post subject: Re: [0.2.2 to 0.2.4] question

Shocked I apologize for the odd questions, it seems that I was accidentally using the 0.2.4 install file instead of the update file. I was able to fix the problem and all seems to be working well!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Advanced mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: