Redirect specific topics to other url

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Redirect specific topics to other url

Postby Globetrotter » Wed Oct 07, 2009 7:38 pm

Hey all,

I would like to add an extra table to my forum database where I can link specific content to a forum thread. When people click the linked thread they will be redirected to the content url in stead of the topic url.

Any idea if this is possible with phpbb3, to change the url by joining with this extra table and add some code to replace the topic url for a complete new one?

I hope someone can help me get started.

Not sure if this ith the best forum to ask my question, but feel free to move it.
Globetrotter
 
Posts: 41
Joined: Sat Sep 06, 2008 2:17 pm

Advertisement

Re: Redirect specific topics to other url

Postby iwanttobelieve » Thu Oct 08, 2009 3:53 pm

umm...What exactly do you mean? Can we have an example?
iwanttobelieve
PR1
PR1
 
Posts: 123
Joined: Sun Jun 14, 2009 5:37 am
Location: Somewhere I don't belong lol

Re: Redirect specific topics to other url

Postby Globetrotter » Thu Oct 08, 2009 7:17 pm

Unfortunately I do not have a working example but I will try to explain what I would like to achieve.

Just like all other topics I would like to have topics in the forum which seems to represents forum topics. (see first image).

When a topic is linked to content (to an other section of my website) I would like to change the url of this topic in the forum overview. When you click one of these (linked)topics you would go to -http://www.mysite.com/article/123.html instead of -http://www.mysite.com/forum/topictitle-t3315.html

Topics linked to articles on other sections of the website are the only topics which will be redirected. I would like to store the linked topics in a newly created table in the phpbb3 database with an topic id and a content id.

When the forum is processed I would like to add an extra join to (the query to) see if a topic is linked to content, if it's linked I would like to change the url of the topic.

Does this make sense ? :)
Attachments
forum.gif
forum.gif (10.43 KiB) Viewed 1495 times
Globetrotter
 
Posts: 41
Joined: Sat Sep 06, 2008 2:17 pm

Re: Redirect specific topics to other url

Postby Professional » Thu Oct 08, 2009 7:29 pm

plz say your board url i think i can help u
انجمن تخصصی نسل جدید موبایل ها-Apple Portal
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 550
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Re: Redirect specific topics to other url

Postby Globetrotter » Thu Oct 08, 2009 8:34 pm

Professional wrote:plz say your board url i think i can help u

Can you help here as well? Or else send me a PM with details what you have in mind.
Globetrotter
 
Posts: 41
Joined: Sat Sep 06, 2008 2:17 pm

Re: Redirect specific topics to other url

Postby Professional » Thu Oct 08, 2009 9:10 pm

no just say your forum url i'll say my suggestions here.
انجمن تخصصی نسل جدید موبایل ها-Apple Portal
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 550
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Re: Redirect specific topics to other url

Postby iwanttobelieve » Fri Oct 09, 2009 3:54 am

"When a topic is linked to content (to an other section of my website)" what kind of content is that and how would you link a topic to a content on our site?
iwanttobelieve
PR1
PR1
 
Posts: 123
Joined: Sun Jun 14, 2009 5:37 am
Location: Somewhere I don't belong lol

Re: Redirect specific topics to other url

Postby Globetrotter » Fri Oct 09, 2009 7:49 am

iwanttobelieve wrote:"When a topic is linked to content (to an other section of my website)" what kind of content is that and how would you link a topic to a content on our site?

I would do that by joining the topic query with a linking table. I will fill the linking table with my own cms.
Globetrotter
 
Posts: 41
Joined: Sat Sep 06, 2008 2:17 pm

Re: Redirect specific topics to other url

Postby Globetrotter » Tue Oct 13, 2009 7:13 am

Anyone?
Globetrotter
 
Posts: 41
Joined: Sat Sep 06, 2008 2:17 pm

Re: Redirect specific topics to other url

Postby dcz » Sun Oct 18, 2009 12:46 pm

So basically, what you want is the same as forum links, but for topics. If you know a bit of php/mysql, you could add an extra column to the topic table, or simply add a new table listing topic id and redirect url.
Then, in viewtopic.php, you could deal with this after :
Code: Select all
$topic_id = (int) $topic_data['topic_id'];

Eg check if there is a redirect to perform and do it if so.
The tricky part would be to add the extra field in the posting template, for the column addition case, you can inspire from the Ultimate SEO URL mod since it adds an extra column to the topic table and makes it editable (can be for admin only).
But if you only have few of them, you could as well just add them manually with phpmyadmin.

++
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


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests