In Russian mod_rewrite is not working correctly

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

In Russian mod_rewrite is not working correctly

Postby dot » Mon Nov 10, 2008 1:32 pm

I have a phpBB SEO Premod V 3.0.2 and URL rewriting type is Advanced.

In Russian mod_rewrite is not working correctly, does not put the keywords in the URL.

examples

Board index ‹ Your first category ‹ На русском языке
-http://www.****.com/dev/forum-f9/

Board index ‹ Your first category ‹ На русском языке < Новости
-http://www.****.com/dev/forum-f9/topic-t7.html

But in English is works.

Board index ‹ Your first category ‹ Your first forum
-http://www.****.com/dev/your-first-forum/

Board index ‹ Your first category ‹ Your first forum < Advanced SEO URL
-http://www.****.com/dev/your-first-forum/advanced-seo-url-t6.html
dot
 
Posts: 1
Joined: Mon Nov 10, 2008 1:03 pm

Advertisement

Postby dcz » Thu Nov 27, 2008 9:55 am

Well, only A-Z0-9_- characters can be used without troubles in urls.

Our mod rewrite will only inject these chars (when there is some of them in title) in the urls. This is mainly useful for site still using some of these characters, so it would make sens for example for a Russian technical web forum, since CSS, HTML, etc could still be widely used among Russian words.

The mixed mod rewrite can be a good solution in your case too, since you could still use A-Z characters for forums urls and have them used in the topic ones :
example.com/forum-url/topicxx.html (topic can be replaced with whatever you want using the allowed characters).

But if you never use a-z characters, then the simple mod rewrite is the way to go.

++
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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Re: In Russian mod_rewrite is not working correctly

Postby Dr.MOON » Sat May 01, 2010 10:05 am

For russian language need aditional prepare url, for example in phpbb_seo_class.php version 0.4.8 working code is:

Code: Select all
   // --> URL rewriting functions <--
   /**
   * Prepare Titles for URL injection
   */
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = htmlentities($url, ENT_COMPAT, 'utf-8');
      $rus = array('ё','ж','ц','ч','ш','щ','ю','я','Ё','Ж','Ц','Ч','Ш','Щ','Ю','Я','А','Б','В','Г','Д','Е','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ъ','Ы','Ь','Э','а','б','в','г','д','е','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ъ','ы','ь','э');
          $lat = array('yo','zh','tc','ch','sh','sh','yu','ya','YO','ZH','TC','CH','SH','SH','YU','YA','A','B','V','G','D','E','Z','I','J','K','L','M','N','O','P','R','S','T','U','F','H','_','I','_','E','a','b','v','g','d','e','z','i','j','k','l','m','n','o','p','r','s','t','u','f','h','_','i','_','e');
          $url = str_replace($rus,$lat,$url);
          $url = strtr($url,
           "АБВГДЕЗИЙКЛМНОПРСТУФХЪЫЬЭабвгдезийклмнопрстуфхъыьэ",
           "ABVGDEZIJKLMNOPRSTUFH_I_Eabvgdezijklmnoprstufh_i_e");      
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\\1", $url );
      $url = preg_replace( $this->seo_opt['url_pattern'] , '-', $url);
      $url = strtolower(trim($url, '-'));
      return empty($url) ? $type : $url;
   }


How to add example of this code in new version for correctly working?
User avatar
Dr.MOON
 
Posts: 7
Joined: Mon Apr 19, 2010 5:15 am
Location: Ukraine

Re: In Russian mod_rewrite is not working correctly

Postby dcz » Sat May 01, 2010 12:20 pm

Custom replacement for title injection

You'll find the replacement for Russian in the second post, and also a slightly different version in the second page (I'm not really able to tell the difference worhtness sorry).

++
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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Re: In Russian mod_rewrite is not working correctly

Postby Dr.MOON » Sat May 01, 2010 7:18 pm

I try added in setup_phpbb_seo.php after this code:
Code: Select all
      // ===> Custom url replacements <===
      // Here you can set up custom replacements to be used in title injection.
      // Example : array( 'find' => 'replace')
      //   $this->url_replace = array(
      //      // Purely cosmetic replace
      //      '$' => 'dollar', '€' => 'euro',
      //      '\'s' => 's', // it's => its / mary's => marys ...
      //      // Language specific replace (German example)
      //      'ß' => 'ss',
      //      'Ä' => 'Ae', 'ä' => 'ae',
      //      'Ö' => 'Oe', 'ö' => 'oe',
      //      'Ü' => 'Ue', 'ü' => 'ue',
      //   );


this code with russian letters replacement, but this metod isn't helpful fo me (don't looking at my working site - I try this method only at the test server)... :
Code: Select all
      $this->url_replace = array(
            'ё'   =>   'yo',
            'ж'   =>   'zh',
            'ц'   =>   'tc',
            'ч'   =>   'ch',
            'ш'   =>   'sh',
            'щ'   =>   'sh',
            'ю'   =>   'yu',
            'я'   =>   'ya',
            'Ё'   =>   'YO',
            'Ж'   =>   'ZH',
            'Ц'   =>   'TC',
            'Ч'   =>   'CH',
            'Ш'   =>   'SH',
            'Щ'   =>   'SH',
            'Ю'   =>   'YU',
            'Я'   =>   'YA',
            'А'   =>   'A',
            'Б'   =>   'B',
            'В'   =>   'V',
            'Г'   =>   'G',
            'Д'   =>   'D',
            'Е'   =>   'E',
            'З'   =>   'Z',
            'И'   =>   'I',
            'Й'   =>   'J',
            'К'   =>   'K',
            'Л'   =>   'L',
            'М'   =>   'M',
            'Н'   =>   'N',
            'О'   =>   'O',
            'П'   =>   'P',
            'Р'   =>   'R',
            'С'   =>   'S',
            'Т'   =>   'T',
            'У'   =>   'U',
            'Ф'   =>   'F',
            'Х'   =>   'H',
            'Ъ'   =>   '_',
            'Ы'   =>   'I',
            'Ь'   =>   '_',
            'Э'   =>   'E',
            'а'   =>   'a',
            'б'   =>   'b',
            'в'   =>   'v',
            'г'   =>   'g',
            'д'   =>   'd',
            'е'   =>   'e',
            'з'   =>   'z',
            'и'   =>   'i',
            'й'   =>   'j',
            'к'   =>   'k',
            'л'   =>   'l',
            'м'   =>   'm',
            'н'   =>   'n',
            'о'   =>   'o',
            'п'   =>   'p',
            'р'   =>   'r',
            'с'   =>   's',
            'т'   =>   't',
            'у'   =>   'u',
            'ф'   =>   'f',
            'х'   =>   'h',
            'ъ'   =>   '_',
            'ы'   =>   'i',
            'ь'   =>   '_',
            'э'   =>   'e',

      );


Has Anybody another ideas?
User avatar
Dr.MOON
 
Posts: 7
Joined: Mon Apr 19, 2010 5:15 am
Location: Ukraine

Re: In Russian mod_rewrite is not working correctly

Postby dcz » Sun May 02, 2010 12:39 pm

Well, if you indeed are using phpBB3 and the latest USU, it should.
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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Re: In Russian mod_rewrite is not working correctly

Postby Dr.MOON » Sun May 02, 2010 11:55 pm

dcz wrote:Well, if you indeed are using phpBB3 and the latest USU, it should.

So, in clean instal it work fine, but for me when I have upgraded it from phpbb 3.04 (version of SEO-mod is 0.4.8 ) theme topics are not working with russian. (I try with recomended upgrade from 3.04 to 3.05, from 3.05 to 3.06, from 3.06 to 3.07PL).
But if I will add a new topic, it's work... How to update my previos topics with this mod to work fine?
User avatar
Dr.MOON
 
Posts: 7
Joined: Mon Apr 19, 2010 5:15 am
Location: Ukraine

Re: In Russian mod_rewrite is not working correctly

Postby hungphutho » Thu May 06, 2010 4:28 am

thank :
hungphutho
 
Posts: 7
Joined: Wed May 05, 2010 5:07 pm


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 17 guests