MyBB Community Forums

Full Version: Google SEO Plugin and Nginx
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys

First post as just getting to grips with MyBB! Blush

I've installed the latest version on my server (which is running Nginx not Apache) and am trying to get the SEO plugin to work.

This is the config my sys admin suggested I go with... does this look right?

Quote: rewrite ^/([^&]*)&(.*)$ http://getleanforums.com/$1?$2 permanent;

rewrite ^/forum-([0-9]+)\.html$ /forumdisplay.php?fid=$1;
rewrite ^/forum-([0-9]+)-page-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2;
rewrite ^/thread-([0-9]+)\.html$ /showthread.php?tid=$1;
rewrite ^/thread-([0-9]+)-page-([0-9]+)\.html$ /showthread.php?tid=$1&page=$2;
rewrite ^/thread-([0-9]+)-lastpost\.html$ /showthread.php?tid=$1&action=lastpost;
rewrite ^/thread-([0-9]+)-nextnewest\.html$ /showthread.php?tid=$1&action=nextnewest;
rewrite ^/thread-([0-9]+)-nextoldest\.html$ /showthread.php?tid=$1&action=nextoldest;
rewrite ^/thread-([0-9]+)-newpost\.html$ /showthread.php?tid=$1&action=newpost;
rewrite ^/thread-([0-9]+)-post-([0-9]+)\.html$ /showthread.php?tid=$1&pid=$2;
rewrite ^/post-([0-9]+)\.html$ /showthread.php?pid=$1;
rewrite ^/announcement-([0-9]+)\.html$ /announcements.php?aid=$1;
rewrite ^/user-([0-9]+)\.html$ /member.php?action=profile&uid=$1;
rewrite ^/calendar-([0-9]+)\.html$ /calendar.php?calendar=$1;
rewrite ^/calendar-([0-9]+)-year-([0-9]+)\.html$ /calendar.php?action=yearview&calendar=$1&year=$2;
rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ /calendar.php?calendar=$1&year=$2&month=$3;
rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ /calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4;
rewrite ^/calendar-([0-9]+)-week-(n?[0-9]+)\.html$ /calendar.php?action=weekview&calendar=$1&week=$2;
rewrite ^/event-([0-9]+)\.html$ /calendar.php?action=event&eid=$1;
rewrite ^/archive/index.php/forum-([0-9]+)\.html$ /archive/index.php?forum-$1.html;
rewrite ^/archive/index.php/thread-([0-9]+)\.html$ /archive/index.php?thread-$1.html;

# Google SEO 404:
ErrorDocument 404 /forum/misc.php?google_seo_error=404

# Google SEO Sitemap:
rewrite ^/((?i)sitemap-([^./]+)\.xml)$ /misc.php?google_seo_sitemap=$2;

# Google SEO URL Forums:
rewrite ^/((?i)Forum-([^./]+))$ /forumdisplay.php?google_seo_forum=$2;

# Google SEO URL Threads:
rewrite ^/((?i)Thread-([^./]+))$ /showthread.php?google_seo_thread=$2;

# Google SEO URL Announcements:
rewrite ^/((?i)Announcement-([^./]+))$ /announcements.php?google_seo_announcement=$2;

# Google SEO URL Users:
rewrite ^/((?i)User-([^./]+))$ /member.php?action=profile&google_seo_user=$2;

# Google SEO URL Calendars:
rewrite ^/((?i)Calendar-([^./]+))$ /calendar.php?google_seo_calendar=$2;

# Google SEO URL Events:
rewrite ^/((?i)Event-([^./]+))$ /calendar.php?action=event&google_seo_event=$2;
^ it looks fine. you can use it.
Great thanks for the quick reply.  Just tried it and all working Cool

One more question sorry! How the URL's are presented out the box isn't ideal as I need to ensure the parent name is always in the URL... as that is going to be a very big part of most search terms I think.  Have seen a few more tweaks I can make in the Plugin settings but at a loss in regards to how to make the changes to the config.

If I wanted to make the amends attached what additions would I need to make to the config above?
as I understand it,
Thread-{url} can be changed to Thread/{URL}
Forum-{url} can be changed to Forum/{URL}

i.e. something should exist from parent to avoid conflicts

Google SEO plugin pack consists of detailed guidance in a html file (in plugins folder of the package)

please see Avoid Scheme Conflicts