Skip to:
Content
Pages
Categories
Search
Top
Bottom

Url Rewriting Problem

Viewing 3 replies - 1 through 3 (of 3 total)

  • Sam Bauers
    Participant

    @sambauers

    The short answer is that you can’t.

    bbPress would have no way to tell whether it was searching for a topic or a forum.

    instead of this can i change topic to konu (‘konu’ is translation of topic in Turkish )


    Ben L.
    Member

    @nightgunner5

    Yes, you would need to go into your .htaccess file, plus something to make sure topic links went there… I’ll look into it.

    Here it is:

    Go into your bb-includes/template-functions.php. Find the function called get_topic_link, it should look like this:

    function get_topic_link( $id = 0, $page = 1 ) {
    $topic = get_topic( get_topic_id( $id ) );

    $args = array();

    $rewrite = bb_get_option( 'mod_rewrite' );
    if ( $rewrite ) {
    if ( $rewrite === 'slugs' ) {
    $column = 'topic_slug';
    } else {
    $column = 'topic_id';
    }
    $link = bb_get_option('uri') . "topic/" . $topic->$column . ( 1 < $page ? "/page/$page" : '' );
    } else {
    $link = bb_get_option('uri') . 'topic.php';
    $args['id'] = $topic->topic_id;
    $args['page'] = 1 < $page ? $page : false;
    }

    if ( $args )
    $link = add_query_arg( $args, $link );

    return apply_filters( 'get_topic_link', $link, $topic->topic_id );
    }

    Change 'topic/' to 'konu/'.

    Now, go into your .htaccess file. If you’re using Options +MultiViews, I don’t know how this will work, but if you’re using mod_rewrite, here’s what to do:

    Find the lines that look like

    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=$1 [L,QSA]

    and change them to

    RewriteRule ^konu/([^/]+)/page/([0-9]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^konu/([^/]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=$1 [L,QSA]

    I think that’s all you’ll need to do…

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar