10-09-2020, 04:29 PM
How to set up the Google SEO plugin for MyBB forums.
The MyBB SEO plugin helps to create memorable semantic urls and will also generate a canonical url and meta description for all forum topics. Dynamic sitemaps and 404 error page management is included.
The Google SEO plugin requires a set of custom rewrites in your .htaccess file to override the default forum urls.
read_more
Google SEO 1.8.4 - Support Topic :
https://community.mybb.com/thread-202483.html
Download :
https://community.mybb.com/mods.php?action=view&pid=789
Source :
https://github.com/frostschutz/MyBB-Google-SEO
--
1) Download plugin
2) Upload files to server
3) Install & activate from admin cp
--
Upload plugin files to /inc/plugins/
Upload language files to /inc/languages/
Go to admin cp -> plugins -> install & activate
check plugin configuration
enable seo urls
check .htaccess file exists
/--
Fixes
/--
This is the code I've added to fix the redirect issue here on Ninja Admins forum.
Note that we're using custom segments - 'topic' and 'forum' instead of the default settings.
moderation.php - redirects to wrong url
https://community.mybb.com/thread-226655.html
/--
Edit showthread template to always generate absolute urls.
Redirects within directory structure :
https://github.com/frostschutz/MyBB-Goog.../issues/43
/--
action=last-post - redirects to 404 not found page
Remove / hide these links from displaying in the showthread template.
--
SEO Plugin Modifications :
Moved the canonical url and meta description from the bottom, to the top section of the head beneath the page title.
--
The MyBB SEO plugin helps to create memorable semantic urls and will also generate a canonical url and meta description for all forum topics. Dynamic sitemaps and 404 error page management is included.
The Google SEO plugin requires a set of custom rewrites in your .htaccess file to override the default forum urls.
Quote:MyBB SEO plugin replaces the stock MyBB URLs with descriptive URLs that use words (thread subject, forum title, user name, etc) instead of random numeric ID
read_more
Google SEO 1.8.4 - Support Topic :
https://community.mybb.com/thread-202483.html
Download :
https://community.mybb.com/mods.php?action=view&pid=789
Source :
https://github.com/frostschutz/MyBB-Google-SEO
--
1) Download plugin
2) Upload files to server
3) Install & activate from admin cp
--
Upload plugin files to /inc/plugins/
Upload language files to /inc/languages/
Go to admin cp -> plugins -> install & activate
check plugin configuration
enable seo urls
check .htaccess file exists
/--
Fixes
/--
This is the code I've added to fix the redirect issue here on Ninja Admins forum.
Note that we're using custom segments - 'topic' and 'forum' instead of the default settings.
moderation.php - redirects to wrong url
https://community.mybb.com/thread-226655.html
Code:
/**
* Special redirect that takes a return URL into account
*
* Added fix for Google SEO plugin issues :
* moderation.php breaking Google SEO redirects
* https://community.mybb.com/thread-226655.html
*
* @param string $url URL
* @param string $message Message
* @param string $title Title
*/
function moderation_redirect( $url, $message = '', $title = '' )
{
global $mybb;
if( ! empty( $mybb->input['url'] ) ) {
$url = htmlentities( $mybb->input['url'] );
}
if( my_strpos( $url, $mybb->settings['bburl'] . '/' ) !== 0 )
{
if( my_strpos( $url, '/' ) === 0 ) {
$url = my_substr( $url, 1 );
}
$url_segments = explode( '/', $url );
$thread_segment = 'topic'; // TODO :: get setting directly from seo plugin
$forum_segment = 'forum'; // TODO :: get setting directly from seo plugin
if( ! empty( $url_segments[0] ) && ( $url_segments[0] === $thread_segment || $url_segments[0] === $forum_segment ) ) {
$url = $mybb->settings['bburl'] . '/' . implode( '/', $url_segments );
} else {
$url = $mybb->settings['bburl'] . '/' . end( $url_segments );
}
}
redirect( $url, $message, $title );
}
/--
Edit showthread template to always generate absolute urls.
Redirects within directory structure :
https://github.com/frostschutz/MyBB-Goog.../issues/43
/--
action=last-post - redirects to 404 not found page
Remove / hide these links from displaying in the showthread template.
--
SEO Plugin Modifications :
Moved the canonical url and meta description from the bottom, to the top section of the head beneath the page title.
--