Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: mod-rewrite and charset windows-1250

  1. #1
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default mod-rewrite and charset windows-1250

    Hello,
    I have upgraded Indexu to 3.2 version, but I have problems with mod-rewrite function. See at my http://www.vsevedko.sk (but now i have mod-rewrite disableo, because it does not work correctly).

    I am using charset=windows-1250 (i have to use symbols like ľ,š,č,ť,ž,ý,á,*,é,ô,ú,ä...) but every links generated have to use symbols l,s,c,t,z,y,a,i,e,o,u,a...
    mod-rewrite is ready for english language (l,s,c,t,z,y,a,i,e,o,u,a), but not for languages of central Europe, like slovak language...
    I hope you understand...
    My english is not good... :-)
    Thanks for your help.

    Vsevedko

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Warning: fopen(cache/index_.html): failed to open stream: Permission denied in /domains1/gh028400/public/www_root/index.php on line 199
    To fix it, you should chmod 777 cache folder

    but every links generated have to use symbols l,s,c,t,z,y,a,i,e,o,u,a...
    mod-rewrite is ready for english language (l,s,c,t,z,y,a,i,e,o,u,a), but not for languages of central Europe, like slovak language...
    does indexu produce:
    http://www.vsevedko.sk/browse-vzdelávanie-6-1.html
    or
    http://www.vsevedko.sk/browse-vzdelavanie-6-1.html

  3. #3
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    Quote Originally Posted by dody
    To fix it, you should chmod 777 cache folder



    does indexu produce:
    http://www.vsevedko.sk/browse-vzdelávanie-6-1.html
    or
    http://www.vsevedko.sk/browse-vzdelavanie-6-1.html
    Cool, chmod 777 on cache folder helps (and also on counter folder).

    Right, that is my problem: mod-rewrite makes links like http://www.vsevedko.sk/browse-vzdelávanie-6-1.html but I need links like http://www.vsevedko.sk/browse-vzdelavanie-6-1.html.

    Another example.
    mod-rewrite:
    http://www.vsevedko.sk/browse-spoloč...udia-51-1.html
    but I need:
    http://www.vsevedko.sk/browse-spoloc...udia-51-1.html

    I think there is necesary to change something in .htaccess, but I dont know what.
    Thanks for your help very much, Dody.
    Last edited by vsevedko; 09-08-2004 at 06:12 AM.

  4. #4
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default I thing i got it (mod-rewrite and charset win-1250)

    Into .htaccess i add this:

    RewriteRule ^/(.*)č(.*) /$1c$2 [R,NE,NC]
    RewriteRule ^/(.*)*(.*) /$1i$2 [R,NE,NC]
    RewriteRule ^/(.*)á(.*) /$1a$2 [R,NE,NC]
    RewriteRule ^/(.*)ľ(.*) /$1l$2 [R,NE,NC]
    RewriteRule ^/(.*)ý(.*) /$1y$2 [R,NE,NC]
    RewriteRule ^/(.*)ť(.*) /$1t$2 [R,NE,NC]
    RewriteRule ^/(.*)ó(.*) /$1o$2 [R,NE,NC]
    RewriteRule ^/(.*)ž(.*) /$1z$2 [R,NE,NC]
    RewriteRule ^/(.*)é(.*) /$1e$2 [R,NE,NC]
    RewriteRule ^/(.*)š(.*) /$1s$2 [R,NE,NC]
    RewriteRule ^/(.*)ô(.*) /$1o$2 [R,NE,NC]
    RewriteRule ^/(.*)ú(.*) /$1u$2 [R,NE,NC]
    RewriteRule ^/(.*)ä(.*) /$1a$2 [R,NE,NC]
    RewriteRule ^/(.*)ě(.*) /$1e$2 [R,NE,NC]
    RewriteRule ^/(.*)ů(.*) /$1u$2 [R,NE,NC]
    RewriteRule ^/(.*)ř(.*) /$1r$2 [R,NE,NC]
    RewriteRule ^/(.*)ň(.*) /$1n$2 [R,NE,NC]

  5. #5
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Right, that is my problem: mod-rewrite makes links like http://www.vsevedko.sk/browse-vzdelávanie-6-1.html but I need links like http://www.vsevedko.sk/browse-vzdelavanie-6-1.html.
    I see ...
    you just need to make conversion from á,ä to a .. .etc.

    Please read mod_rewrite_guide.txt from indexu zip file to fine where you need to convert those characters.

    To make conversion, just add more codes with str_replace
    PHP Code:
    $name2 str_replace('ä','a',$name2);
    $name2 str_replace('á','a',$name2); 
    until all characters converted. Please read mod_rewrite_guide.txt

  6. #6
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    Quote Originally Posted by dody
    I see ...
    you just need to make conversion from á,ä to a .. .etc.

    Please read mod_rewrite_guide.txt from indexu zip file to fine where you need to convert those characters.

    To make conversion, just add more codes with str_replace
    PHP Code:
    $name2 str_replace('ä','a',$name2);
    $name2 str_replace('á','a',$name2); 
    until all characters converted. Please read mod_rewrite_guide.txt
    I did it in category.class.php but it doesnot work...
    Please look at the attachment...
    Thanks.
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    1,180

    Default mod

    Quote Originally Posted by vsevedko
    I did it in category.class.php but it doesnot work...
    Please look at the attachment...
    Thanks.
    Hello,

    I didn't check your file, but I remeber, that there are more than one place there you have to change the rewriting !
    Be sure you get all, because if link type is defined in its own lines...

    Regards
    Frank

  8. #8
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    Quote Originally Posted by Frank71
    Hello,

    I didn't check your file, but I remeber, that there are more than one place there you have to change the rewriting !
    Be sure you get all, because if link type is defined in its own lines...

    Regards
    Frank
    I changed it at three places... as I saw in mod_rewrite_guide.txt.
    Please help...

  9. #9
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    1,180

    Default

    Hm, I never used 3.2 or 3.2E, only tried it in some first 3.2 files before it was released.

    If you changed it at 3 places some links must be ok !
    Check your internal links where you still have the problem.
    If it is in browse start searching in browse.php and the place for it in category class.
    If it is in another view start there.
    I dind'tread the instructions, too, I did all by hand
    But if Dody wrote something I'm sure something must work.

    Possible places:
    Link in main categories, link in subcategories, link in categorypath, hm 3
    Ah, link for the detail page and may be for tjis also for hot, new, top_rated, new and so on.
    Not sure, but I think there must be 4 places, one also in link class.
    Ask esm, he must know the places from v3.2E, if he read my postings

    Regards
    Frank

  10. #10
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    Quote Originally Posted by Frank71
    If you changed it at 3 places some links must be ok !
    Check your internal links where you still have the problem.
    I searched, but there is no correct link...

    Quote Originally Posted by Frank71
    If it is in browse start searching in browse.php and the place for it in category class.
    If it is in another view start there.
    I tried, but its too hard for me. I am not so good in PHP...

    Quote Originally Posted by Frank71
    Not sure, but I think there must be 4 places, one also in link class.
    Yes, i finally found fourth place in link.class.php, but still nothing has happend. I did "update category path" and "delete cache files" also.

    I changed all 4 places where I found $mod_rewrite_replacement_str_arr = ...

  11. #11
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Code:
          //$href = "<a href=$file?cat=$cat>";
          $name2 = str_replace(' ','_',$name);
          $name2 = str_replace('/','_',$name2);
          $name2 = str_replace('\\','_',$name2);
          $name2 = str_replace(',','_',$name2);
          $name2 = str_replace('#','_',$name2);
          $name2 = str_replace('è','c',$name2);
          $name2 = str_replace('*','i',$name2);
          $name2 = str_replace('á','a',$name2);
          $name2 = str_replace('¾','l',$name2);
          $name2 = str_replace('ý','y',$name2);
          $name2 = str_replace('','t',$name2);
          $name2 = str_replace('ó','o',$name2);
          $name2 = str_replace('ž','z',$name2);
          $name2 = str_replace('é','e',$name2);
          $name2 = str_replace('š','s',$name2);
          $name2 = str_replace('ô','o',$name2);
          $name2 = str_replace('ú','u',$name2);      
          $name2 = str_replace('ä','a',$name2);
          $name2 = str_replace('ì','e',$name2);      
          $name2 = str_replace('ù','u',$name2);
          $name2 = str_replace('ø','r',$name2);      
          $name2 = str_replace('ò','n',$name2);      
                      
          $mod_rewrite_replacement_str_arr =
            array(' ','-','/','\\',',','#',':',';','\'','"','[',']',
              '{','}','|','`','~','!','@','%','$','^','&','*','=','+');
          $name2 = str_replace($mod_rewrite_replacement_str_arr,'_',$name);
          $href = strtolower("<a href=browse-$name2-$cat-1.html>");
          $close_href = "</a>";
    You have to be real careful with variable names. You start out just fine. you have

    Code:
          $name2 = str_replace(' ','_',$name);
    After the string replacement, this places the contents of $name into $name2.

    then you have a series of

    Code:
          $name2 = str_replace('/','_',$name2);
    that is OK.

    but then you overwrite the contents of $name2 with $name by using the following

    Code:
    $name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_', $name);
    make one small change to the above line

    Code:
    $name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_' , $name2);
    try that...
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  12. #12
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    also:

    Code:
    $cat_name2 = str_replace('è','c',$cat_name2);
    should be
    Code:
    $cat_name2 = str_replace('è','c',$cat_name);
    and

    Code:
    $cat_name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_' ,$cat_name);
    should be
    Code:
    $cat_name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_' ,$cat_name2);
    also change

    Code:
    $sub_name2 = str_replace('è','c',$sub_name2);
    to
    Code:
    $sub_name2 = str_replace('è','c',$sub_name);
    then
    Code:
    $sub_name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_' ,$sub_name);
    to
    Code:
    $sub_name2 = str_replace ( $mod_rewrite_replacement_str_arr, '_' ,$sub_name2);
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  13. #13
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    I tried everything you wrote... but nothing has changed. I am frustrated...


  14. #14
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    post your category.class.php file again and let's look at it. "if'n it ain't working, it ain't right."
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  15. #15
    Join Date
    Feb 2004
    Location
    Slovakia
    Posts
    72

    Default

    Quote Originally Posted by esm
    post your category.class.php file again and let's look at it. "if'n it ain't working, it ain't right."
    Here you are... thank you very much.
    Vsevedko
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •