Jump to content


Photo

PHPBB-Seo to Ip.Board 3 - Keep same URL's in Mod_Rewrite


  • Please log in to reply
19 replies to this topic

#1 Silnei L Andrade

Silnei L Andrade

    IPB Newbie

  • Members
  • Pip
  • 5 posts

Posted 02 May 2012 - 08:13 PM

Hello guys,

Is possible convert a PHPBB-SEO Forum to IP.Board and keep same SEO friendly URL's?


In phpbb-seo the URL of my forum have this config:

Topic Rules = My PHPBB-SEO Forum
http://[domain] / [title]-[t + topic ID]. [html]

Example:
http://www.mochileiros.com/combustivel-para-fogareiros-t30770.html


In IP.Board Community the URL Rules are:

Topic Rules = IP.Board Community
http://[domain] / [topic] / [ topic ID]-[Topic title] /

Example:
http://community.invisionpower.com/topic/354472-converter-question/

Is possible create a Mod_Rewrite Rules to make IP.Board keep my URL's?

Thanks in advance,

Silnei
  • forumvie likes this

#2 Feld0

Feld0

    Advanced Member

  • Members
  • PipPipPipPip
  • 320 posts

Posted 04 May 2012 - 06:21 PM

Keeping the same URL's isn't possible, but 301-redirecting them is! This will prevent any links to the phpBB-SEO links from breaking and allow search engines to readjust to the new URL's without dropping your rankings.

I had to do a bit of .htaccess tweaking to keep my phpBB-SEO URL's when I converted TheWiiU.com to IP.Board last year. phpBB-SEO maps URL's to the stock phpBB URL's, which the converter tools will redirect properly. The trick is to redirect all the URL's back to the original phpBB URL's, and the redirection tool in the converters will redirect those to the IP.Board URL's. You have to carefully combine and order the .htaccess rules that come with each piece of software for it to work.

Here's my .htaccess file - feel free to use it yourself. Just be sure to replace every instance of "thewiiu.com" with your board's URL and modify the "RewriteBase" rule appropriately if your forum is in a subdirectory.

Options -MultiViews
RewriteEngine On
RewriteBase /

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
#  RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
#  RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^thewiiu\.com$ [NC]
# RewriteRule ^(.*)$ http://thewiiu.com/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]

#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forum\.html$ /index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /redirect.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/redirect.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
#RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/?$ /redirect.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /redirect.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /redirect.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /redirect.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /redirect.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /redirect.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /redirect.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
# RewriteRule ^the-team\.html$ /redirect.php?mode=leaders [QSA,L,NC]

# FORUM WITHOUT ID & DELIM ALL MODES
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /redirect.php?forum_uri=$1&start=$3 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################

#####################################################
RewriteCond %{HTTP_HOST} ^www.thewiiu.com$
RewriteRule ^(.*)$ "http\:\/\/thewiiu\.com$1" [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

  • Bruno Dias and SidV like this

~ The Feldian Network ~

MLP Forums - the friendliest forum on the ponynet

TheWiiU.com - the original Wii U forum community


#3 Sefket

Sefket

    Spam Happy

  • +Clients
  • 943 posts

Posted 04 May 2012 - 07:07 PM

Keeping the same URL's isn't possible, but 301-redirecting them is! This will prevent any links to the phpBB-SEO links from breaking and allow search engines to readjust to the new URL's without dropping your rankings.

I had to do a bit of .htaccess tweaking to keep my phpBB-SEO URL's when I converted TheWiiU.com to IP.Board last year. phpBB-SEO maps URL's to the stock phpBB URL's, which the converter tools will redirect properly. The trick is to redirect all the URL's back to the original phpBB URL's, and the redirection tool in the converters will redirect those to the IP.Board URL's. You have to carefully combine and order the .htaccess rules that come with each piece of software for it to work.

Here's my .htaccess file - feel free to use it yourself. Just be sure to replace every instance of "thewiiu.com" with your board's URL and modify the "RewriteBase" rule appropriately if your forum is in a subdirectory.

Options -MultiViews
RewriteEngine On
RewriteBase /

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
#  RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
#  RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^thewiiu\.com$ [NC]
# RewriteRule ^(.*)$ http://thewiiu.com/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]

#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forum\.html$ /index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /redirect.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/redirect.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
#RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/?$ /redirect.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /redirect.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /redirect.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /redirect.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /redirect.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /redirect.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /redirect.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /redirect.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
# RewriteRule ^the-team\.html$ /redirect.php?mode=leaders [QSA,L,NC]

# FORUM WITHOUT ID & DELIM ALL MODES
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /redirect.php?forum_uri=$1&start=$3 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################

#####################################################
RewriteCond %{HTTP_HOST} ^www.thewiiu.com$
RewriteRule ^(.*)$ "http\:\/\/thewiiu\.com$1" [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


I used SMF forums so what would I use?

I convert, install IPB Boards, and more! Check my shop here.
Three important things for your website


#4 Feld0

Feld0

    Advanced Member

  • Members
  • PipPipPipPip
  • 320 posts

Posted 04 May 2012 - 10:46 PM

I used SMF forums so what would I use?


Unfortunately, I have no experience with SMF so someone else will have to answer that for you. This topic was specifically referring to the phpBB-SEO add-on for phpBB, and the code I posted is simply what I use on one of my own sites, since I've used the same add-on myself. I suggest you create your own topic to ask for help with rewriting SMF URL's. ;)

~ The Feldian Network ~

MLP Forums - the friendliest forum on the ponynet

TheWiiU.com - the original Wii U forum community


#5 Bruno Dias

Bruno Dias

    IPB Newbie

  • Visitors
  • Pip
  • 4 posts

Posted 05 May 2012 - 11:07 AM

I try this

RewriteEngine On
RewriteCond %{QUERY_STRING} (t|f)=([0-9]+)
RewriteRule ^view(topic|forum)\.php$ /index.php?show$1=%2 [R=301,L]
this code get phpbb url and convert to ipb, but the IDs of topcis and foruns has been changed, so the code redirect to another topic/forum

phpbb http://myphpbbforum....wforum.php?f=12 redirect to http://myipbforum/in...hp?showforum=12 but the ids are diferents foruns.

#6 Kemble

Kemble

    IPB Full Member

  • +Clients
  • 100 posts

Posted 05 May 2012 - 11:11 AM

Feld0,

I converted 90K+ posts from my phpbb 3 forums, I did not have the pbphh-SEO mod you mentioned. But I do have 1000's of links inside my community that points to other threads inside the community. They all look soemthing like:
[url="http://www.mydomain.org/forums/viewtopic.php?p=83893#p83893"]name of link[/url]
Would your rewrite rule work for me?

IP.Board 3.4.5
IP.Blog 2.6.3
IP.Calendar 3.3.4
IP.Chat 1.4.4
IP.Content 2.3.6
IP.Downloads 2.5.4
IP.Gallery 5.0.5
IP.Nexus 1.5.8


#7 Bruno Dias

Bruno Dias

    IPB Newbie

  • Visitors
  • Pip
  • 4 posts

Posted 06 May 2012 - 12:33 PM

Feld0,

I converted 90K+ posts from my phpbb 3 forums, I did not have the pbphh-SEO mod you mentioned. But I do have 1000's of links inside my community that points to other threads inside the community. They all look soemthing like:

[url="http://www.mydomain.org/forums/viewtopic.php?p=83893#p83893"]name of link[/url]
Would your rewrite rule work for me?

i have same situation.
waiting

#8 Feld0

Feld0

    Advanced Member

  • Members
  • PipPipPipPip
  • 320 posts

Posted 07 May 2012 - 07:10 AM

Feld0,

I converted 90K+ posts from my phpbb 3 forums, I did not have the pbphh-SEO mod you mentioned. But I do have 1000's of links inside my community that points to other threads inside the community. They all look soemthing like:

[url="http://www.mydomain.org/forums/viewtopic.php?p=83893#p83893"]name of link[/url]
Would your rewrite rule work for me?

i have same situation.
waiting


If you didn't use phpBB-SEO, then the redirection tools included with the converter will have everything you need. It's been a while since I converted, but there should be documentation included with the converter tools download on how to set up redirects from your old topic links.
  • Bruno Dias likes this

~ The Feldian Network ~

MLP Forums - the friendliest forum on the ponynet

TheWiiU.com - the original Wii U forum community


#9 Bruno Dias

Bruno Dias

    IPB Newbie

  • Visitors
  • Pip
  • 4 posts

Posted 08 May 2012 - 10:27 AM

i have several indexed links in google, then i will lose these links :sad:

#10 Kemble

Kemble

    IPB Full Member

  • +Clients
  • 100 posts

Posted 08 May 2012 - 10:52 AM

If you didn't use phpBB-SEO, then the redirection tools included with the converter will have everything you need. It's been a while since I converted, but there should be documentation included with the converter tools download on how to set up redirects from your old topic links.

We do not use phpBB-SEO. I did not see anything pertaining on how to rewrite or redirect links inside posts that link to other threads.

IP.Board 3.4.5
IP.Blog 2.6.3
IP.Calendar 3.3.4
IP.Chat 1.4.4
IP.Content 2.3.6
IP.Downloads 2.5.4
IP.Gallery 5.0.5
IP.Nexus 1.5.8


#11 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 27 May 2012 - 06:24 PM

I am using phpBB-SEO and I am converting to IP Board. For URL puposes, I understood that I should use the .htaccess file to return URLs to the original phpbb format. But I would like to install IP Board on a different directory. How should I proceed not to mess around URLs 301 redirection?

#12 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 02 June 2012 - 05:18 PM

Hello, I am having a real bad time trying to redirect my old phpbb-seo URLs to new IPB URLs.

The phpbb-seo is in "directory-one", the new IPB is in "directory-two".

I followed the steps given here and edited my phpbb-seo .htaccess file to correspond to the directives given by Feld0.

I tried to put base directory "directory-one" and "directory-two".

None worked.

IPB returns a 404 message.

As long as the scripts phpbb-seo and IPB are on different directories, I have two .htaccess files.

One for phpbb-seo (the one that I am trying to change) and another one for IPB (I am noting messing with this one).

The directives given here tell me to combine the 2 .htaccess files, but in my case, different directories mean 2 .htaccess files, right?

The other thing that seems odd to me is the "redirect.php" file that is mentioned on the .htaccess file suggested.

Where is this "redirect.php"? The converter brought in tools "config.php", "memberlist.php", "viewforum.php" and "viewtopic.php".

There is no "redirect.php".

On IPB directory there is no "redirect.php" either.

I have a look at phpbb-seo website and found this link: http://www.phpbb-seo...hilit=uninstall

I found there a "redirect.php", made the configuration changes and uploaded to my phpbb-seo directory, but it didn't work either.

Any ideas?

#13 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 02 June 2012 - 05:30 PM

Reading carefully the Feld0 post, he says " the redirection tool in the converters"...

I guess this topic is outdated, as long as the new conververts don't come with a redirection tool or "redirect.php", but now there is a change on "memberlist.php", "viewforum.php" and "viewtopic.php".

I tried to keep original .htaccess of phpbb-seo, but IPB returns a 404 answser for phpbb-seo links.

#14 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 03 June 2012 - 10:34 AM

I am suspecting that the error is being cause by IPB converter itself. I saw that in version 1.1.6, the version that I am using, It's suppose to be correct 404 errors. I guess the error was not completely fixed.

As long as new converter replaces "memberlist.php", "viewforum.php" and "viewtopic.php", I guess there is no need for changing .htaccess of phpbb-seo forum directory.

The URL will be readed by the converter as the original, it's just what the .htaccess mod rewirte does. Am I wrong?

#15 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 05 June 2012 - 08:05 PM

The problem is definitively is on IPB redirection scripts.

I have found a simple solution here: http://community.inv...nk-redirection/

Just had to take care of the new database schema.

#16 Silnei L Andrade

Silnei L Andrade

    IPB Newbie

  • Members
  • Pip
  • 5 posts

Posted 02 July 2012 - 06:00 PM

Hi Sobrenome,

You convert your phpbb-seo forum and keep the same URL using this method?

#17 sobrenome

sobrenome

    Spam Happy

  • Members
  • PipPipPipPipPip
  • 563 posts

Posted 24 October 2012 - 07:49 PM

No, the URLs are new, IP.Board style. But the old ULRs are redirecting to the new ones with the proper message, telling google that was a change on URL, but the content is the same. 



#18 Silnei L Andrade

Silnei L Andrade

    IPB Newbie

  • Members
  • Pip
  • 5 posts

Posted 07 February 2013 - 04:06 AM

Hi Sobrenome,

 

With the redirection of all pages indexed in Google they continue as before or there was loss of hearing?



#19 forumvie

forumvie

    IPB Newbie

  • Visitors
  • Pip
  • 1 posts

Posted 14 June 2013 - 08:38 AM

Not sure we can do that directly via mod_rewrite but  ipb_conv_link_topics table give the connection between phpbb topics id and ipb topics id.

Who can write a piece of code for 301 redirection? :-)



#20 Erwane

Erwane

    IPB Newbie

  • Visitors
  • Pip
  • 2 posts

Posted 08 March 2014 - 07:30 PM

Here is the solution, based on Feld0 post :

 

  • Go into your converters/Tools.Links - phpBB folder and copy 4 files to your IPB root.
  • Edit the config.php file to patch your IPB installation and convert id (something like that : define('CONV_ID', 'convert_phpbb');)

Everything should works fine.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users