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  
 
   
Problem with Advanced RC3: words less than 3 characters

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
::  
Author Message
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Sun Jul 29, 2007 9:41 pm    Post subject: Problem with Advanced RC3: words less than 3 characters

I have just installed Advanced RC3 Mod with phpBB3 RC4. All seems fine, but the new filters for words less than 3 characters do not work. I have uncommented the lines but it still shows links like http://domain.com/comunidad/welcome-to-phpbb3-t1.html
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Tue Jul 31, 2007 1:53 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

I'm migrating my site tonight... could somebody check if this issue is something general? Or maybe it's my installation... If I don't fix this, I'll have to stay with those words >2 characters forever!
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 11:05 am    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Help Sad
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 4006

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 12:45 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Open :

phpbb_seo/phpbb_seo_class.php

Find :

Code:
      $url = ( empty($url) ) ? $type : strtolower($url);


Replace with :

Code:
      if ( !empty($url) ) {
         $url = explode('-', $url);
         foreach ($url as $key => $value) {
            if (strlen($value) < 3) {
               unset($url[$key]);
            }
         }
         $url = strtolower(implode('-', $url));
      } else {
         $url = $type;
      }


And keep the original small word filtering commented.

Wink

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 12:52 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Great, thank you! I have 4 hours left to my migration! God bless you!

Also, I have noticed that some URLs show "--" in some topics... could this be fixed too?

THANK YOU BIG BIG THANK YOU! I'll show you my new forums after the migration Smile
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 4006

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 1:22 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Make sure you have exactly :
Code:

      $this->seo_opt['url_pattern'] = array('`&(amp;)?#?[a-z0-9]+;`i', // html/xml entities
         '`[^a-z0-9]`i', // Non a-z0-9 chars
         // Uncomment to filter words of one and two letters
         //'`^[a-z0-9]{1,2}[-]+`i', // Ending with and hyphen
         //'`[-]+[a-z0-9]{1,2}$`i', // Staring with an hyphen
         // Uncomment to as well filter url of less than three letters :
         // z1-txx.html vs topic-txx.html
         //'`^[a-z0-9]{1,2}$`i', // Single word in title
         '`[-]+`' // Do not remove : multi hyphen reduction
      );

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 1:45 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Thank you very much! I have initiated my migration just now so I can't test the code. I'll tell you later (about 3 hours).

Remember that I'm willing to sponsor this mod, at least with some donations over the time. Thank you again.
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 6:02 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Hey SeO, it works great but it adds / at the end of the forum titles, simulating a virtual path and breaking the CSS design. How could I get rid of that / ?

Thank you!
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 4006

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 6:30 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

You can edit precisely the way you want the suffixes with the phpBB SEO mod rewrite.

Look in phpbb_seo_class.php :

Code:
      $this->seo_ext = array('cat' => '.html',
         'forum' => '/',
         'topic' => '.html',
         'user' => '.html',
         'gz_ext' => '',
      );


You can change it to :

Code:
      $this->seo_ext = array('cat' => '.html',
         'forum' => '.html',
         'topic' => '.html',
         'user' => '.html',
         'gz_ext' => '',
      );


And then update your .htaccess accordingly :
Code:

RewriteRule ^[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$1&start=$3 [QSA,L,NC]

For the forum, or
Code:

RewriteRule ^[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?(\.html|/)$ /viewforum.php?f=$1&start=$3 [QSA,L,NC]


To allow both types at the .htaccess level and let the zero duplicate do its job Wink

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
Xabi
PR0
PR0


Joined: 20 Jun 2007
Posts: 52

Problem with Advanced RC3: words less than 3 charactersPosted: Thu Aug 02, 2007 7:35 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Greeat Very Happy Is it any difference between finishing an URL with "nothing" or ".html"? I mean:

-http://91.151.105.116/forums/quiero-grabar-saxo-t164169
-http://91.151.105.116/forums/quiero-grabar-saxo-t164169.html

and

-http://91.151.105.116/forums/estudio-f5
-http://91.151.105.116/forums/estudio-f5.html

Which is better? Thank you!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

Problem with Advanced RC3: words less than 3 charactersPosted: Fri Aug 03, 2007 5:50 pm    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Not really.

.html is just the original, but you could use whatever suffixe you would prefer.

Using nothing makes the rewriterules a bit more opened, but there is no problem with it thanks to the zero duplicate so ...

That's part of why it is advised to test a bit locally when first installing the mod. Few user in the end change the default standard, but the phpbb_seo class is really flexible for changing the way url will in the en look like.

It's just a matter of updating the .htaccess accordingly.

++

_________________
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
pvchat1



Joined: 15 Jul 2007
Posts: 13
Location: California

Problem with Advanced RC3: words less than 3 charactersPosted: Mon Aug 06, 2007 12:26 am    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

I had the same problem where small words were not being removed from the URL. I think there are some problems in the search/replace expression. I was able to get the correct results when I made the following mod:

Find:
Code:
      // preg_replace() pattern for format_url()
      $this->seo_opt['url_pattern'] = array('`&(amp;)?#?[a-z0-9]+;`i', // html/xml entities
         '`[^a-z0-9]`i', // Non a-z0-9 chars
         // Uncomment to filter words of one and two letters
         //'`^[a-z0-9]{1,2}[-]+`i', // Ending with and hyphen
         //'`[-]+[a-z0-9]{1,2}$`i', // Staring with an hyphen
         // Uncomment to as well filter url of less than three letters :
         // z1-txx.html vs topic-txx.html
         //'`^[a-z0-9]{1,2}$`i', // Single word in title
         '`[-]+`' // Do not remove : multi hyphen reduction
      );


and replace with:
Code:
      // preg_replace() pattern for format_url()
      $this->seo_opt['url_pattern'] = array('`&(amp;)?#?[a-z0-9]+;`i', // html/xml entities
         '`[^a-z0-9]`i', // Non a-z0-9 chars
         // Uncomment to filter words of one and two letters
         '`-[a-z0-9]{1,2}(?=-)`i', // start/end with hyphen
         '`^[a-z0-9]{1,2}-`i', // Ending with hyphen
         '`-[a-z0-9]{1,2}$`i', // Starting with hyphen
         // Uncomment to as well filter url of less than three letters :
         // z1-txx.html vs topic-txx.html
         '`^[a-z0-9]{1,2}$`i', // Single word in title
         '`[-]+`' // Do not remove : multi hyphen reduction
      );
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

Problem with Advanced RC3: words less than 3 charactersPosted: Sun Aug 12, 2007 8:49 am    Post subject: Re: Problem with Advanced RC3: words less than 3 characters

Thanks a lot Wink

It's faster to use a single call to preg_replace() than to explode() url and filter words in a loop, so this makes a nice bug fix.

++

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
Page 1 of 1

Navigation Similar Topics

Jump to: