Giter Site home page Giter Site logo

Comments (5)

frostschutz avatar frostschutz commented on July 20, 2024

Google SEO redirects Thread-Title links back to showthread.php?tid=123 links, if you revert code changes or set scheme URL to empty.

If you keep the database and MyBB code alive (move to a subdir) and rewrite Google SEO URLs to that subdir, it will continue doing those redirects for you. Then your new forum software can pick up the showthread.php?tid=123 links and redirect those to what-ever it is in the new forum system.

Basically old rewriterule:

RewriteRule ^Thread\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

New rewriterule:

RewriteRule ^Thread\-([^./]+)$ old_mybb/showthread.php?google_seo_thread=$1 [L,QSA,NC]

That'd be the approach that doesn't involve any additional coding. The script is already there. Redirecting back to original URLs, was part of GoogleSEO's features from the start. Only catch is that you have to keep GoogleSEO (and thus MyBB) installed somewhere.

Of course, you could condense that into more concise code by taking only the relevant portions from redirect.php and url.php, and only the google_seo table, with no need to keep the full mybb install around. Then rewrite everything to a standalone google_seo_redirect.php which knows how to query the google_seo table same way Google SEO itself does. But I don't have such a script at this time, sorry.

If anyone wants to contribute such a thing, I'd be happy to add it into the package.

from mybb-google-seo.

 avatar commented on July 20, 2024

That'd be the approach that doesn't involve any additional coding. The script is already there. Redirecting back to original URLs, was part of GoogleSEO's features from the start. Only catch is that you have to keep GoogleSEO (and thus MyBB) installed somewhere.

Thank you for answering so quickly and with such detail!
I don't mind keeping Mybb around in a secondary directory, no problem.

But, If I change the rewrite rule like you mention, wouldn't that just redirect all old mybb links to the mybb thread instead of the new xenforo thread? Am I not missing an extra rule?

from mybb-google-seo.

frostschutz avatar frostschutz commented on July 20, 2024

It will redirect to yoursite/showthread.php?tid=123 (not the subdir, provided you don't set bburl to the subdir, which you shouldn't do). So even though MyBB is in a subdir, Google SEO will still believe the non-subdir is the correct location, according to your bburl setting.

of course you need something to pick it up from there, I can't help you with that. your new forum needs to know at minimum how to redirect the original mybb URLs.

from mybb-google-seo.

 avatar commented on July 20, 2024

your new forum needs to know at minimum how to redirect the original mybb URLs.

Perhaps what I'm going to say is wrong, but then would adding a rule like this after the one you mentioned do the trick?
Something like:

RewriteRule ^showthread.php?tid=([0-9+])$ threads/$1 [L,QSA,NC]

Considering xenforo links are of the form https://site.com/threads/1234/

from mybb-google-seo.

frostschutz avatar frostschutz commented on July 20, 2024

You'd have to match %{QUERY_STRING} instead.

RewriteCond %{QUERY_STRING} tid=([0-9]+)
RewriteRule showthread.php threads/%1

or something like it

from mybb-google-seo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.