MyBB Community Forums

Full Version: Google SEO Legacy 1.4.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Glad you like it. Smile

Could the others who had this issue (okitai, etc) report back wether the fix above works for you too? Thanks!
Sorry @frostschutz, but the change didn't correct the error - had to add '/admin/'.
So it still failed to load googleseo_settings.lang.php for you? That's odd. But without being able to reproduce your problem I can't fix it either, cause I have no idea what's wrong. The error here was a broken language file - language files mustn't define $l['language'] or $l['path'] or $l['settings']. Check if any of your language files do that.

You could also add the following line before the $lang->load(googleseo_settings):

echo "<pre>".htmlspecialchars(print_r(array($lang->language, $lang->path, $lang->settings), true))."</pre>";

and post or PM me the output. If $lang->language is not 'english' or 'hebrew' or whatever the language you're using, it'll most likely be the fault of one of the *.lang.php files.

For English, it looks like this:
Array
(
    [0] => english/admin
    [1] => /var/www/localhost/htdocs/MyBB/1405/inc/languages
    [2] => Array
        (
            [name] => English (American)
            [author] => MyBulletinBoard
            [website] => http://www.mybboard.net/
            [version] => 1405
            [admin] => 1
            [rtl] => 0
            [htmllang] => en
            [charset] => UTF-8
        )
)
Ok I'm getting this in my plugin area

Add to .htaccess:

And I have added everything that it has as well as checked to see if my host allows rewrite, and they do and pretty much looked at this thread for an hour.

Can some help me with this.

Here is my what I have in the htaccess file

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on

        # Some hosts require you to specify a RewriteBase
        # RewriteBase /forum/

	# As first rewrite rule, Google SEO workaround for search.php 

highlights:
	RewriteRule ^([^&]*)&(.*)$ http://www.musikhead.com/forum/$1?$2 

[L,QSA,R=301]


	RewriteRule ^forum-([0-9]+).html forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?

fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+).html showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?

tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?

tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?

tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?

tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?

tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?

tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+).html showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$1 

[L,QSA]

	RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$1 

[L,QSA]

	RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?

action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html 

calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^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 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?

action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$1 

[L,QSA]

	# 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]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/x-javascript text/css 

text/html text/xml
</IfModule>

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

I'm get this error when ever I click on a link.

Not Found

The requested URL /forum/Forum-New-Heads-Introduction-Forum was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Here is the output:
Array
(
    [0] => Language Selection Box
    [1] => /var/www/vhosts/ithelp.co.il/httpdocs/forum/inc/languages
    [2] => Array
        (
            [name] => English (American)
            [author] => MyBulletinBoard
            [website] => http://www.mybboard.net/
            [version] => 1400
            [admin] => 1
            [rtl] => 0
            [htmllang] => en
            [charset] => UTF-8
        )

)
As you can see, there's a problem. I'm not really sure why. The only thing I can think of is either the MyBB team, here, in Israel did something wrong when they packed/patched the English package to work in Hebrew, or because of an "old" solution for the default language setting, there's a coding error in one the PHP files.
I can tell you that I'll do an upgrade to either 1.4.5 or I'll wait for the 1.6, so solving this problem (especially as it now works fine), isn't the top most thing I'm interested in. I do need to get my forums up and running with the documents I wrote as soon as I can - this was delayed for to long now.
Thanks to dared who provided the debug output for the Turkish language pack as well as a download link to the Turkish lanugage pack, I was able to reproduce.

This is a bug in the language pack, and was probably a bug in older versions of MyBB.

Find the following line in inc/languages/<Your Language Here>/admin/config_settings.lang.php:
$l['language'] = ...

In MyBB 1.4.4 and 1.4.5 this entry is called language_selection_box so you have to change this line to:
$l['language_selection_box'] = ...

I don't know in which version of MyBB it was renamed, but I suggest you update to the latest MyBB version anyways, as there were also several security fixes in the meantime. If your language packs still contain $l['language'] in admin/config_settings.lang.php, I suggest you report a bug to the maintainers of your language pack.

I can't work around this issue in my plugin. It has to be fixed in the language pack.
frostschutz can you point to a post are something that will me help out?

(2009-04-25, 01:55 AM)kevinliles Wrote: [ -> ]Ok I'm getting this in my plugin area

Add to .htaccess:

And I have added everything that it has as well as checked to see if my host allows rewrite, and they do and pretty much looked at this thread for an hour.

Can some help me with this.

Here is my what I have in the htaccess file

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on

        # Some hosts require you to specify a RewriteBase
        # RewriteBase /forum/

	# As first rewrite rule, Google SEO workaround for search.php 

highlights:
	RewriteRule ^([^&]*)&(.*)$ http://www.musikhead.com/forum/$1?$2 

[L,QSA,R=301]


	RewriteRule ^forum-([0-9]+).html forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?

fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+).html showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?

tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?

tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?

tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?

tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?

tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?

tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+).html showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$1 

[L,QSA]

	RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$1 

[L,QSA]

	RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?

action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html 

calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^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 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?

action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$1 

[L,QSA]

	# 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]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/x-javascript text/css 

text/html text/xml
</IfModule>

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

I'm get this error when ever I click on a link.

Not Found

The requested URL /forum/Forum-New-Heads-Introduction-Forum was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Oh, sorry kevinliles, seems I missed your reply.

Your .htaccess looks broken beyond repair, what did you do to it? Do you have a small monitor or does your editor wrap or something? You have many line breaks in there that do not belong, e.g.

    # As first rewrite rule, Google SEO workaround for search.php 

highlights:
    RewriteRule ^([^&]*)&(.*)$ http://www.musikhead.com/forum/$1?$2 

[L,QSA,R=301]

should be
    # As first rewrite rule, Google SEO workaround for search.php highlights:
    RewriteRule ^([^&]*)&(.*)$ http://www.musikhead.com/forum/$1?$2 [L,QSA,R=301]

You have this issue in basically all your rules, not just the Google SEO ones.

Start with a clean .htaccess (the htaccess.txt in the MyBB package). See the htaccess.txt.example in the Google SEO package for an example how it should look like with standard URL scheme. (Although I just noticed that htaccess.txt.example is outdated, whoops - I'll update it in the next version).
Ok I check and the word wrap was on so I turned it off and got a fresh htaccess.txt file and I'm still having the same problems.

???Do I put the htaccess file in the home directory of the forum??? Because thats where I have it.

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on

        # Some hosts require you to specify a RewriteBase
        # RewriteBase /MyBB/

	# As first rewrite rule, Google SEO workaround for search.php highlights:
	RewriteRule ^([^&]*)&(.*)$ http://musikhead.com/forum/$1?$2 [L,QSA,R=301]

	RewriteRule ^forum-([0-9]+).html forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+).html showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+).html showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$1 [L,QSA]

	RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$1 [L,QSA]

	RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^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 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$1 [L,QSA]

	# 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]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>

# Google SEO 404:
ErrorDocument 404 /forum/misc.php?google_seo_error=404
This looks much better now.

You rename it from htaccess.txt to .htaccess and upload it to your main MyBB directory (same place as index.php showthread.php forumdisplay.php etc.)

What's the plugin status say about htaccess after you upload this file?
Do MyBB Search Engine Friendly URLs work for you? (thread-x.html style like here)

If it does not work then, your host either doesn't support mod_rewrite or your host requires some extra stuff somewhere to enable mod_rewrite, one possibility is the RewriteBase, another possibility is that you have to enable mod_rewrite in your host configuration panel first.