301 redirect after conversion from another forum

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators


301 redirect after conversion from another forum

Postby surfbit » Mon May 19, 2008 6:05 pm

Hello,

I'm a new user! :D

I converted my old fireboard forum to phpbb3, but now I've a problem with url rewriting.
My old url were such this: -www.mydomain.com/forum/board-title/topic-title.html

Now, with phpBB3 my new url are such this: -http://www.mydomain.com/forum/board-title/topic-title-txx.html

I removed SID from my PCA, but in the URL remains -txx. Can I remove this?
If this isn't possible I'd like to redirect the old url to the newest.. How can I do it?
I can't do a manual 301 redirect for every url, they are too many.. :(

Can you help me?

Thank you very much!
surfbit
 
Posts: 2
Joined: Mon May 19, 2008 5:46 pm

Advertisement

Postby SeO » Tue May 20, 2008 9:39 am

So you did not have any topic ids in your rewritten topic url before ?

It's not an option for our mod so far, and I'm not sure it will, because I don't think that the extra sql involved would be this worth it.

Anyway, this makes redirecting a little harder, if not impossible in case you use .html as forum suffix and get rid of forum ids (forum-url.html), because we would have trouble to distinguish between an old topic url and a new forum url.

Now if you do use a slash as forum suffix (virtual folder on or custom setting), we can at least add a rewritrule to catch all .html files that do not exist and try to treat them as topic url. Problem is, your previous fireboard install most likely used an extra sql field for topics, holding the topic url.

So what should be done would be to :
1) copy the topic url column and insert it in the phpBB topic table, the column would remain empty for all topic posted after the conversion.
2) use a rewriterule such as :
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-z0-9_-]+)\.html$ /redir.php?title=$1 [QSA,L,NC]

After the phpBB3 rewriterules in your .htaccess.

Note that here, I do not handle pagination, I'd need to know how it was handled to do it, so please give me an example.
As well, I involve a redir.php script (to be created), which would grab the title GET var and perform a select over the topic url column. If we get a match, then we'd redirect to the corresponding new topic url and would return a 404 if not.

As you see, this would mean to write a redirection script, which is not very hard in case you know a bit of php/mysql, I cannot think of a better way to do it in your case.

If the solution pleases you, I can provide with more help ;)
SeO
Admin
Admin
 
Posts: 6035
Joined: Wed Mar 15, 2006 9:41 pm

Postby surfbit » Thu May 22, 2008 8:51 am

Thank you for your reply.. I'll try your solution.. :D
I think I'll come back soon.. :roll:
surfbit
 
Posts: 2
Joined: Mon May 19, 2008 5:46 pm


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google [Bot] and 5 guests


 
cron