How many of us convert their board from phpbb to smf and lose all the hard work on google? >:(
I wrote a little piece of solution. ;)
Its not complete but it works for the more important urls
It redirect these pages to new urls
- forums
- topics
- members profile
- profile page
- search
- members list
- faq
- pm
- online members
RewriteEngine On
RewriteCond %{QUERY_STRING} ^f=([0-9]+).*$
RewriteRule ^viewforum.php$ /forums/index.php?board=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^t=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forums/index.php?topic=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^mode=viewprofile&u=([0-9]+)$
RewriteRule ^profile.php$ /forums/index.php?action=profile;u=%1 [R=301,L,NE]
#
RewriteRule ^search.php$ /forums/index.php?action=search [R=301,L]
RewriteRule ^profile.php$ /forums/index.php?action=profile [R=301,L]
RewriteRule ^faq.php$ /forums/index.php?action=help [R=301,L]
RewriteRule ^privmsg.php$ /forums/index.php?action=pm [R=301,L]
RewriteRule ^memberlist.php$ /forums/index.php?action=mlist [R=301,L]
RewriteRule ^viewonline.php$ /forums/index.php?action=who [R=301,L]
Mine phpbb installation is in foo.com/forum and I redirect to foo.com/forums, the smf dir
So, you need only to create .htaccess file in your old phpbb directory, and copy this code in it. Rember to change the word forums to your SMF location.
Live exampleForum Index Url:
http://userbarmaker.com/forum/
Forum Url:
http://userbarmaker.com/forum/viewforum.php?f=3
Topic Url:
http://userbarmaker.com/forum/vietopic.php?t=797
Cya
Got pretty urls (http://custom.simplemachines.org/mods/index.php?mod=636) and still want to fix things ?
Add this to your .htaccess file (in your forum directory)
For example, my old forum (phpBB) was located in a subdirectory /forum (http://www.tg-jiu.ro/forum/) and my new one is located in the same directory.
So if your OLD forum is /forum and your NEW one is /forums change the /forum/index.php.... to /forums/index....
RewriteCond %{QUERY_STRING} ^f=([0-9]+).*$
RewriteRule ^viewforum.php$ /forum/index.php?pretty;board=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^t=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?topic=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^mode=viewprofile&u=([0-9]+)$
RewriteRule ^profile.php$ /forum/index.php?action=profile;u=%1 [R=301,L,NE]
#
RewriteRule ^search.php$ /forum/index.php?action=search [R=301,L]
RewriteRule ^profile.php$ /forum/index.php?action=profile [R=301,L]
RewriteRule ^faq.php$ /forum/index.php?action=help [R=301,L]
RewriteRule ^privmsg.php$ /forum/index.php?action=pm [R=301,L]
RewriteRule ^memberlist.php$ /forum/index.php?action=mlist [R=301,L]
RewriteRule ^viewonline.php$ /forum/index.php?action=who [R=301,L]
L.E: P.S: you can see a working demo by going to
http://www.tg-jiu.ro/forum/viewtopic.php?t=67
or
http://www.tg-jiu.ro/forum/viewforum.php?f=11
:)
n1 madalin but you need to fix your forum cause there is the PHPSESID in your urls, its not good.
The phpsessid always gets appended to the URL the firs time you load a forum. I think :)
Quote from: madalin on May 31, 2007, 11:03:14 AM
Got pretty urls (http://custom.simplemachines.org/mods/index.php?mod=636) and still want to fix things ?
Add this to your .htaccess file (in your forum directory)
For example, my old forum (phpBB) was located in a subdirectory /forum (http://www.tg-jiu.ro/forum/) and my new one is located in the same directory.
So if your OLD forum is /forum and your NEW one is /forums change the /forum/index.php.... to /forums/index....
RewriteCond %{QUERY_STRING} ^f=([0-9]+).*$
RewriteRule ^viewforum.php$ /forum/index.php?pretty;board=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^t=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?topic=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^mode=viewprofile&u=([0-9]+)$
RewriteRule ^profile.php$ /forum/index.php?action=profile;u=%1 [R=301,L,NE]
#
RewriteRule ^search.php$ /forum/index.php?action=search [R=301,L]
RewriteRule ^profile.php$ /forum/index.php?action=profile [R=301,L]
RewriteRule ^faq.php$ /forum/index.php?action=help [R=301,L]
RewriteRule ^privmsg.php$ /forum/index.php?action=pm [R=301,L]
RewriteRule ^memberlist.php$ /forum/index.php?action=mlist [R=301,L]
RewriteRule ^viewonline.php$ /forum/index.php?action=who [R=301,L]
L.E: P.S: you can see a working demo by going to
http://www.tg-jiu.ro/forum/viewtopic.php?t=67
or
http://www.tg-jiu.ro/forum/viewforum.php?f=11
:)
gotcha..gotta try it. I need to redirect 301 those old bad urls to a new pretty one :D
Many thanks friends ... that was so beautiful and useful for me to keep all archived pages at google and other search engines ...
since there are some important kinds of urls which include forum No. or posts No.
these kinds also need to be redirected such as:
/phpbb/viewtopic.php?f=11&t=1111 >> /smf/index.php?&topic=1111.0
/phpbb/viewtopic.php?f=11&p=111111 >> smf/index.php?&msg=111111.0
I added a suitable solution ... may it will be helpful ;)
RewriteEngine On
RewriteCond %{QUERY_STRING} ^f=([0-9]+).*$
RewriteRule ^viewforum.php$ /forum/index.php?board=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^t=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?topic=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^f=([0-9]+)&t=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?&topic=%2.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^f=([0-9]+)&p=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?msg=%2.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^p=([0-9]+).*$
RewriteRule ^viewtopic.php$ /forum/index.php?msg=%1.0 [R=301,L]
#
RewriteCond %{QUERY_STRING} ^mode=viewprofile&u=([0-9]+)$
RewriteRule ^profile.php$ /forum/index.php?action=profile;u=%1 [R=301,L,NE]
#
RewriteRule ^search.php$ /forum/index.php?action=search [R=301,L]
RewriteRule ^profile.php$ /forum/index.php?action=profile [R=301,L]
RewriteRule ^faq.php$ /forum/index.php?action=help [R=301,L]
RewriteRule ^privmsg.php$ /forum/index.php?action=pm [R=301,L]
RewriteRule ^memberlist.php$ /forum/index.php?action=mlist [R=301,L]
RewriteRule ^viewonline.php$ /forum/index.php?action=who [R=301,L]
sorry for my english :-[
Thank God for this topic! Otherwise, I would've wasted several hours trying to figure this out! Thanks!