External incoming links

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sinucello
    Senior Member
    • Mar 2006
    • 133
    • 4.2.X

    External incoming links

    Hi,

    after switching a big forum that already existed several years to vbulletin, there will be a lot of external direct-links (Google!) formerly pointing to threads or postings of your forum that won`t work anymore. Therefore it would be great if some kind of translation table could be created during the import. This could be the basis of some Apache-rewrite rules that create redirect permanent lines out of this table.

    I need such a feature and in the open source world, I would now start a call for sponsoring and ask who else is interested and would throw a few bucks in the bucket. But this is a commercial system and I have no clue how it is handled here.

    Ciao,
    Sacha
    Thermomix, Rezepte und Küchenmaschinen
  • Jerry
    Senior Member
    • Dec 2002
    • 9137
    • 1.1.x

    #2
    I've thought of two main ways of doing this.

    a) Apache, probably with mod_rewrite and using the existing import id's in the database to find the new post/thread URL.

    b) A 404 page. From the old URL you can get the $_SERVER['REQUEST_URI'] or $_SERVER['REDIRECT_QUERY_STRING'] from there you can get the 404 page to give a "Wait looking up the new page, I'm going to redirect you" message.

    An example would be (a link to a phpBB thread) :



    The 404 page looks up the thread where the importthreadid is 372469 and directs you there, personally I would add some logging as well.

    Though this would have to be done on a per system basics as the URL and file names are all different, i.e. phpBB uses viewtopic.php we use showthread.php other systems use different names and GET data.
    I wrote ImpEx.

    Blog | Me

    Comment

    • Jerry
      Senior Member
      • Dec 2002
      • 9137
      • 1.1.x

      #3
      Thinking about it, I'm going to do this, if you want to help test it PM me.
      I wrote ImpEx.

      Blog | Me

      Comment

      • TimS
        Member
        • Oct 2005
        • 40

        #4
        Jerry, I am also very interested in such a creation. Facing the same problem with 7 years worth of incoming links that are going to instantly become useless without some sort of rewrite help.

        Thanks

        TimS
        Striped Bass Fishing - Fishing Forums

        Comment

        • Jerry
          Senior Member
          • Dec 2002
          • 9137
          • 1.1.x

          #5
          Originally posted by TimS
          Jerry, I am also very interested in such a creation. Facing the same problem with 7 years worth of incoming links that are going to instantly become useless without some sort of rewrite help.

          Thanks

          TimS
          A ubb.classic custom 404 could be interesting I'm not 100% familiar with the URL make up for forum/thread/post/user selection, so what I've thought about is...

          Working on the basics of a custom 404 redirect look up where you can add your own "My old URL's look like this and mean this" config, so it can be used for any system, so I don't have to write specific sections for 76 importers
          I wrote ImpEx.

          Blog | Me

          Comment

          • TimS
            Member
            • Oct 2005
            • 40

            #6
            Jerry, the potential problems would be many - not trying to discourage you, but the biggest hurdle would be something I'm facing right now.

            For 4 years I've been running UBB with "spider friendly" URLs with "fake .html extentions" enabled. It's worked wonders for search engines, we are very well indexed. Except the friendly URLs require that ultimatebb.cgi is present and accessible. And the problem with that is, I would like to use a redirect to send any hits to my forum main page (ultimatebb.cgi) to the new vBulletin forum main page.

            And that would no longer allow the spider friendly URLs to work because they don't represent actual html pages.

            Your problem, if you attempt this script, is that there are a number different URL options in UBB - normal, spider friendly using paths, short spider friendly and spider friendly compatibility mode - and then an option to add "fake" .html extensions.

            I'm confused already...good thing I'm not working on this rewrite script, huh?

            TimS
            Striped Bass Fishing - Fishing Forums

            Comment

            • Jerry
              Senior Member
              • Dec 2002
              • 9137
              • 1.1.x

              #7
              This script is going to help redirect users that are using external links and internal link parsing, not to help with search engines.
              I wrote ImpEx.

              Blog | Me

              Comment

              • Jerry
                Senior Member
                • Dec 2002
                • 9137
                • 1.1.x

                #8
                Well I've done it and its in tools/404.php, it will work in place of internal link parsing as well, though you'll have to know how to set up a 404.php page as well as a 2nd 404 page for links that aren't from the old forum.
                I wrote ImpEx.

                Blog | Me

                Comment

                • denby
                  Member
                  • Nov 2004
                  • 44

                  #9
                  Très élégant!

                  At this stage it's only for forums migrated from phpBB2 but hey, I'm happy!

                  For those who'd like to know, here's how to setup the 404.php and fallback 404.htm page.
                  1. Download Impex from the member's area and extract the 404.php file from the /tools folder.
                  2. Edit the 404.php script to configure it for your forum. Jerry has peppered the top of that script with comments and examples.
                  3. Upload 404.php to your forum directory (e.g. http://www.example.com/forum/404.php). chmod it to 644
                  4. Add a new table to your vB database called 404_actions using phpMyAdmin (or some other database interface). See the notes at the top of the 404.php script for the SQL. Be sure to prepend your table prefix to the table name (e.g. vb3404_actions). [should the SQL listing in the script be annotated Jerry?]
                  5. Create an HTML file called 404.htm containing a nicely formatted message about not finding the file your visitor sought and suggesting they contact you if their problem persists. Upload that file to your webroot (e.g. http://www.example.com/404.htm). chmod it to 644
                  6. Create/amend your .htaccess file in your forum directory (e.g. http://www.example.com/forum/.htaccess). You need one ErrorDocument 404 directive that says:
                    Code:
                    ErrorDocument 404 /forum/404.php
                  NOTE: when you configure 404.php (step 2), set the constant $standard_404 to the full URL path of your 404.htm file (e.g. http://www.example.com/404.htm).

                  Have I missed anything?

                  Jerry, your code is simple and sweet but robust. Your timing is perfect as I'm just about to migrate from phpBB2 to VB. So long as I preserve the import IDs after migration, this will allow my members to use links with the old forum URLs and preserve all external links validity into the bargain.

                  Thanks a lot!

                  "All the world's a stage .. coach." - John Wayne

                  Comment

                  • Jerry
                    Senior Member
                    • Dec 2002
                    • 9137
                    • 1.1.x

                    #10
                    Originally posted by denby
                    Très élégant!

                    At this stage it's only for forums migrated from phpBB2 but hey, I'm happy!


                    If there are any other Tier 1 systems that people want this for let me know and I'll add the relevant URL parsing.

                    Originally posted by denby
                    For those who'd like to know, here's how to setup the 404.php and fallback 404.htm page.
                    Originally posted by denby
                    1. Download Impex from the member's area and extract the 404.php file from the /tools folder.
                    2. Edit the 404.php script to configure it for your forum. Jerry has peppered the top of that script with comments and examples.
                    3. Upload 404.php to your forum directory (e.g. http://www.example.com/forum/404.php). chmod it to 644
                    4. Add a new table to your vB database called 404_actions using phpMyAdmin (or some other database interface). See the notes at the top of the 404.php script for the SQL. Be sure to prepend your table prefix to the table name (e.g. vb3404_actions). [should the SQL listing in the script be annotated Jerry?]
                    5. Create an HTML file called 404.htm containing a nicely formatted message about not finding the file your visitor sought and suggesting they contact you if their problem persists. Upload that file to your webroot (e.g. http://www.example.com/404.htm). chmod it to 644
                    6. Create/amend your .htaccess file in your forum directory (e.g. http://www.example.com/forum/.htaccess). You need one ErrorDocument 404 directive that says:
                      Code:
                      ErrorDocument 404 /forum/404.php
                    NOTE: when you configure 404.php (step 2), set the constant $standard_404 to the full URL path of your 404.htm file (e.g. http://www.example.com/404.htm).

                    Have I missed anything?


                    I don't think so, though I'll write a 404.impex.readme.txt now explaining this process.

                    Originally posted by denby
                    Jerry, your code is simple and sweet but robust. Your timing is perfect as I'm just about to migrate from phpBB2 to VB. So long as I preserve the import IDs after migration, this will allow my members to use links with the old forum URLs and preserve all external links validity into the bargain.

                    Thanks a lot!
                    Thanks, welcome to vBulletin
                    I wrote ImpEx.

                    Blog | Me

                    Comment

                    • Jerry
                      Senior Member
                      • Dec 2002
                      • 9137
                      • 1.1.x

                      #11
                      Ok, I've added a 404.impex.readme.txt now to explain how to set it up, as well as how to do a multi import redirect and the SQL I'd use for logging.

                      I plan on adding all the Tier 1 systems to the URL parsing (as possible).
                      I wrote ImpEx.

                      Blog | Me

                      Comment

                      • sinucello
                        Senior Member
                        • Mar 2006
                        • 133
                        • 4.2.X

                        #12
                        Hi,

                        Jerry, thank you very much for your quick solution. I`ll test it next week.

                        Ciao,
                        Sacha
                        Thermomix, Rezepte und Küchenmaschinen

                        Comment

                        • Jerry
                          Senior Member
                          • Dec 2002
                          • 9137
                          • 1.1.x

                          #13
                          Originally posted by TimS
                          Jerry, the potential problems would be many - not trying to discourage you, but the biggest hurdle would be something I'm facing right now.

                          For 4 years I've been running UBB with "spider friendly" URLs with "fake .html extentions" enabled. It's worked wonders for search engines, we are very well indexed. Except the friendly URLs require that ultimatebb.cgi is present and accessible. And the problem with that is, I would like to use a redirect to send any hits to my forum main page (ultimatebb.cgi) to the new vBulletin forum main page.

                          And that would no longer allow the spider friendly URLs to work because they don't represent actual html pages.

                          Your problem, if you attempt this script, is that there are a number different URL options in UBB - normal, spider friendly using paths, short spider friendly and spider friendly compatibility mode - and then an option to add "fake" .html extensions.

                          I'm confused already...good thing I'm not working on this rewrite script, huh?

                          TimS

                          I've added 301 redirect now, so search engines will know what's going on.
                          I wrote ImpEx.

                          Blog | Me

                          Comment

                          • gfuchs
                            New Member
                            • Oct 2005
                            • 17
                            • 3.5.x

                            #14
                            Ubbthreads

                            Don't know if anyone else has asked but I'm working on a Ubbthreads conversion. This would be sweet to have for it.

                            Looking at the script, I think if I just parse viewthreaded.php and viewflat.php I'll probably pick up the vast majority of requests.

                            The rest I'll just dump to the main forum page.

                            Greg
                            Last edited by gfuchs; Wed 17 May '06, 1:59pm.

                            Comment

                            • Jerry
                              Senior Member
                              • Dec 2002
                              • 9137
                              • 1.1.x

                              #15
                              Originally posted by gfuchs
                              Don't know if anyone else has asked but I'm working on a Ubbthreads conversion. This would be sweet to have for it.

                              Looking at the script, I think if I just parse viewthreaded.php and viewflat.php I'll probably pick up the vast majority of requests.

                              The rest I'll just dump to the main forum page.

                              Greg
                              PM me and I'll update the tool with your help for the URLs to parse.
                              I wrote ImpEx.

                              Blog | Me

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...