Info
- 4 posts
- 3 voices
- Started 4 years ago by fikirbozan
- Latest reply from Ben L.
- This topic is not resolved
Url Rewriting Problem
-
- Posted 4 years ago #
How can we get rid of topic or forum in the permanent links
My links like
http://www.mysite.com/topic/wordpress-theme/But i want like
http://www.mysite.com/wordpress-theme/and
my forums links
http://www.mysite.com/forum/wordpress/
but i want like
http://www.mysite.com/wordpress/how can i do this
-
- Posted 4 years ago #
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.
-
- Posted 4 years ago #
instead of this can i change topic to konu ('konu' is translation of topic in Turkish )
-
- Posted 4 years ago #
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 calledget_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
.htaccessfile. If you're usingOptions +MultiViews, I don't know how this will work, but if you're usingmod_rewrite, here's what to do:Find the lines that look like
RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=&page= [L,QSA] RewriteRule ^topic/([^/]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id= [L,QSA]and change them to
RewriteRule ^konu/([^/]+)/page/([0-9]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id=&page= [L,QSA] RewriteRule ^konu/([^/]+)/?$ /[YOUR FORUM DIRECTORY]/topic.php?id= [L,QSA]I think that's all you'll need to do...
-
You must log in to post.