2014-11-08, 02:23 AM
My VPS: 512MB Ram 20GB SSD Disk CentOS 6.5 x64, installed Centminmod(include: NGINX, PHP-FPM and MariaDB)
MyBB version: 1.6.15
I use these rules in block: location /{ ... }
I go to Plugins -> Google SEO plugin -> click to Apply and my forum's URL like:
My forum rewrite URL seem to be OK:
The problem is:
My forum won't redirect me to the forum with URL like this:
It returns 404 Not Found nginx
I found frostschutz's guide: http://community.mybb.com/thread-51764.html
Then I changed rules in location block to:
I go to Configuration->Settings->Server and Optimization Options->Enable search engine friendly URLs? set to Enabled.
Restart Nginx -> OK
BUT everything seems worse! I get 404 errors when clicking on thread / forum links as frostschutz said.
Now I don't know how to solve this problem! Help me please, thanks everyone!
(PS: Sorry for my bad English)
MyBB version: 1.6.15
I use these rules in block: location /{ ... }
Quote: # GOOGLE SEO PLUGIN 1.6.8
# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
rewrite ^/([^&]*)&(.*)$ http://myforum.com/$1?$2 permanent;
# 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;
I go to Plugins -> Google SEO plugin -> click to Apply and my forum's URL like:
Quote:http://myforum.com/Forum-General-Support
http://myforum.com/Thread-[Nginx]-Enabling-Search-Engine-Friendly-URLs
My forum rewrite URL seem to be OK:
Quote:When I type: http://myforum.com/forumdisplay.php?fid=132
Redirect to: http://myforum.com/Forum-General-Support
or
http://myforum.com/showthread.php?tid=47...n=lastpost
Redirect to:
http://myforum.com/Thread-[Nginx]-Enabling-Search-Engine-Friendly-URLs?pid=1127#pid1127
The problem is:
My forum won't redirect me to the forum with URL like this:
Quote:http://myforum.com/thread-132.html
or
http://myforum.com/thread-47-lastpost.html
or
http://myforum.com/forum-132.html
It returns 404 Not Found nginx
I found frostschutz's guide: http://community.mybb.com/thread-51764.html
Then I changed rules in location block to:
Quote:location / {
# ...your location settings are here... r
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;
}
I go to Configuration->Settings->Server and Optimization Options->Enable search engine friendly URLs? set to Enabled.
Restart Nginx -> OK
BUT everything seems worse! I get 404 errors when clicking on thread / forum links as frostschutz said.
Now I don't know how to solve this problem! Help me please, thanks everyone!
(PS: Sorry for my bad English)