MyBB Community Forums

Full Version: Google SEO 1.6.8 [EOL]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2012-09-14, 10:22 AM)Tecca Wrote: [ -> ]Yes, in the root of your forum.

Thanks Tecca,
I did saved it in root of the forum but I could not access the CPanel after that.
I just pasted the below code in a notepad and named it as .htaccess. Later saved it on the forum root directory but it does not let me access the forum then.

Quote:RewriteEngine on
# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /forum/
# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://mcxcommoditytrading.com/forum/$1?$2 [L,QSA,R=301]
# Google SEO 404:
ErrorDocument 404 /forum/misc.php?google_seo_error=404
# Google SEO Sitemap:
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]
# Google SEO URL Forums:
RewriteRule ^Forum-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]
# Google SEO URL Threads:
RewriteRule ^Thread-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]
# Google SEO URL Announcements:
RewriteRule ^Announcement-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]
# Google SEO URL Users:
RewriteRule ^User-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]
# Google SEO URL Calendars:
RewriteRule ^Calendar-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]
# Google SEO URL Events:
RewriteRule ^Event-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]

Please help.
Since your forum is apparently installed in /forum/, you must upload the .htaccess to /forum/.htaccess, i.e. the same place your forum is in. It's different for robots.txt which always has to be in the domain root dir, i.e. /robots.txt

Microsoft Notepad breaks files (it adds an invisible UTF-8 Byte-Order-Mark at the beginning). Don't ever use MS Notepad for anything. Instead try Notepad++ or similar (make sure Codec is set to UTF-8 without Byte-Order-Mark).

Also, your host must support mod_rewrite for rewrite rules to work.
(2012-09-14, 07:48 PM)frostschutz Wrote: [ -> ]Since your forum is apparently installed in /forum/, you must upload the .htaccess to /forum/.htaccess, i.e. the same place your forum is in. It's different for robots.txt which always has to be in the domain root dir, i.e. /robots.txt

Microsoft Notepad breaks files (it adds an invisible UTF-8 Byte-Order-Mark at the beginning). Don't ever use MS Notepad for anything. Instead try Notepad++ or similar (make sure Codec is set to UTF-8 without Byte-Order-Mark).

Also, your host must support mod_rewrite for rewrite rules to work.

You know frostschutz- I am able to access the Cpanel now. I didnt do anything extra but followed ur suggestion. Just saved the .htaccess using notepad ++ and it worked. No problems so far.
Reputation to you. Thanks
Hi,

I've a small question, it is : Is there any chance to force MyBB Stock URL redirect automatically to Google SEO URL ? From here, in my forum, Googlebot always made error crawling...

Thanks in advanced.
Yes, that's what Google SEO Redirect does. It redirect any valid working thread/forum/event/etc. URL to the currently active primary URL. So it redirects to Google SEO URL or (if you no longer wish to use it) back to stock URLs.
(2012-09-22, 08:24 PM)frostschutz Wrote: [ -> ]Yes, that's what Google SEO Redirect does. It redirect any valid working thread/forum/event/etc. URL to the currently active primary URL. So it redirects to Google SEO URL or (if you no longer wish to use it) back to stock URLs.

Hmm, my Google SEO Redirect is already turned on, but it still didn't redirect to. What should I do?
Your redirects (on phiu.net) work fine.

http://www.phiu.net/forum/showthread.php?tid=106

Redirect will only work for working thread URLs; so if it's the MyBB SEF style you're talking about, thread-106.html does not redirect because the URL doesn't work. There are two possible reasons for that:

1) You removed the MyBB SEF rewrite rules from your .htaccess
2) You have conflicts in your URL schemes: thread-106.html could either mean thread with tid 106, or thread with subject 106, if you changed Google SEO's URL style to thread-{url}.html

The best course of action for 2) is to change the Google SEO URL style to something that does not conflict with any other style (e.g. the default), and make sure the MyBB SEF rewrite rules come first in .htaccess

That way it will redirect most URLs fine. Only thread URLs that only have numbers in their subject would break, which shouldn't affect too many threads.
(2012-09-23, 10:13 AM)frostschutz Wrote: [ -> ]Your redirects (on phiu.net) work fine.

http://www.phiu.net/forum/showthread.php?tid=106

Redirect will only work for working thread URLs; so if it's the MyBB SEF style you're talking about, thread-106.html does not redirect because the URL doesn't work. There are two possible reasons for that:

1) You removed the MyBB SEF rewrite rules from your .htaccess
2) You have conflicts in your URL schemes: thread-106.html could either mean thread with tid 106, or thread with subject 106, if you changed Google SEO's URL style to thread-{url}.html

The best course of action for 2) is to change the Google SEO URL style to something that does not conflict with any other style (e.g. the default), and make sure the MyBB SEF rewrite rules come first in .htaccess

That way it will redirect most URLs fine. Only thread URLs that only have numbers in their subject would break, which shouldn't affect too many threads.

Hi, what is MyBB SEF ? Is that MyBB Stock URL?

Anyways, if so I didn't remove the MyBB Stock URL rewrite from .htaccess. And I really don't what is the URL conflics...

Could you explain it easier? Thanks you Smile
MyBB's (supposedly) Search Engine Friendly URL style, as used here, thread-101262.html instead of showthread.php?tid=101262. Both are MyBB stock URLs.

If you use thread-{url}.html for Google SEO you have a conflict with MyBB's Search Engine Friendly URLs because both use thread-something.html for their URLs and thus thread-101262.html could either be a thread with the id 101262, or a thread with the subject 101262. And that's the conflict because the rewrite rule can't tell whether to forward this request to showthread.php?tid=$ or showthread.php?google_seo_url=$. And such a conflict means that either one or the other URL style will break.

In your .htaccess it seems that Google SEO rewrite rules come first, so it rewrites to showthread.php?google_seo_url=101262. If you move the MyBB rewrite rules up it'll go to showthread.php?tid=101262 instead (making the URL work), but that will break all threads which use a number for their subject.

There's no solution that makes both work - you have to choose URL schemes that do not conflict with one another.
Thanks you, so now there's only one solution. It's change my current Google SEO URL from thread-{url}.html -> thread-{url}, rights?