WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can i translate or remove some of the the mod_rewrite rule parameters? (5 posts)

  1. BoInG
    Member
    Posted 8 years ago #

    Now i'm trying to make an mod_rewrite rule for my site. But i have some problems customizing it.

    1. I will like to translate some words from the mod_rewrite rule:
    This one:
    RewriteRule ^page/?([0-9]{1,})/?$ /site/index.php?&pag...
    to
    RewriteRule ^pagina/?([0-9]{1,})/?$ /site/index.php?&pag...

    This thing also avaible for the rest of the words: search to cauta, archive to arhiva, comments to comentarii and so on.

    2. I will like to remove the /category/ directory from the permalink.

    To make this one:
    RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ ... etc
    RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ ... etc
    RewriteRule ^category/(.+)/?$ ... etc

    to
    RewriteRule ^(.+)/(feed|rdf|rss|rss2|atom)/?$ ... etc
    RewriteRule ^(.+)/page/?([0-9]{1,})/?$ ... etc
    RewriteRule ^(.+)/?$ ... etc

    (whitout category in it.)

    3.I'm having some problems also whit the search rewrite rule. It's not working (the oders work in english and is rewriting the url's perfectly). But the search mod_rewrite rule:

    RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /site/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /site/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /site/index.php?s=$1&paged=$2 [QSA,L]
    RewriteRule ^search/(.+)/?$ /site/index.php?s=$1 [QSA,L]

    its not doing nothing. The url remains like:

    http://www.mysite.ro/site/index.php?s=mysearchedword

    and not like:

    http://www.mysite.ro/site/search/mysearchedword/

    Tnq again for your help and sorry for my msg, but i didnt find this kind of info after searching the forum.

  2. BoInG
    Member
    Posted 8 years ago #

    Ok. I have resolved the first 2 problems.

    To translate the mod_rewrite format into another language you will have to open wp-includes/classes.php and search there for the word you will like to change.

    After that change in .htaccess the same words whit the new one.

    Remains the 3rd guestion - i dont know what to do there.

  3. Orin
    Member
    Posted 8 years ago #

    It seems like you're looking for this plugin called "Nice Search".

  4. BoInG
    Member
    Posted 8 years ago #

    Orin - tnq for that - resolved my problem very fast :D

  5. jmesam
    Member
    Posted 8 years ago #

    what did you exactly change in wp-includes/classes.php?

    I want to translate "page" for "pagina", too, but I can't get to run ok for me. There is many 'page' on it.

    Thank you in advance

Topic Closed

This topic has been closed to new replies.

About this Topic