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.
It worked, thanks for the help...
(2010-08-09, 03:32 PM)nunobrito Wrote: [ -> ]Hi FrostSchutz,

I've came to this topic to request help for Lighttpd support instead of Apache. In the meanwhile I've found the past references about Lighttpd rewrite rules and tried them out.

The rules are outdated. I've managed to update them for more recent versions.

I'm using the forums on the root of the domain. Please take a look and see if anything needs to be corrected.

For others trying to use this code, you might already know this but the code needs to be added your lighttpd.conf file as there is no equivalent to .htaccess under lighttpd.

Here is the code:
$HTTP["host"] == "example.com" {
   server.document-root = "/home/example/www"

url.redirect = (
	"^/([^&?]*)&([^?]*)$" => "http://example.com/$1?$2",
	"^/([^&?]*)&([^?]*)\?(.*)$" => "http://example.com/$1?$2&$3",
	)

url.rewrite-once = (
	# Google SEO Sitemap:
	"^/((?i)sitemap-([^./?]+)\.xml)(\?(.*)|)$" => "/misc.php?google_seo_sitemap=$2&$4",
	# Google SEO URL Forums:
	"^/((?i)Forum-([^./?]+))(\?(.*)|)$" => "/forumdisplay.php?google_seo_forum=$2&$4",
	# Google SEO URL Threads:
	"^/((?i)Thread-([^./?]+))(\?(.*)|)$" => "/showthread.php?google_seo_thread=$2&$4",
	# Google SEO URL Announcements:
	"^/((?i)Announcement-([^./?]+))(\?(.*)|)$" => "/announcements.php?google_seo_announcement=$2&$4",
	# Google SEO URL Users:
	"^/((?i)User-([^./?]+))(\?(.*)|)$" => "/member.php?action=profile&google_seo_user=$2&$4",
	# Google SEO URL Calendars:
	"^/((?i)Calendar-([^./?]+))(\?(.*)|)$" => "/calendar.php?google_seo_calendar=$2&$4",
	# Google SEO URL Events:
	"^/((?i)Event-([^./?]+))(\?(.*)|)$" => "/calendar.php?action=event&google_seo_event=$2&$4",
	)
}

Hello !

This is the Google SEO 404 Lighttpd code for this Mod :

## Google SEO 404:
server.error-handler-404 = "/misc.php?google_seo_error=404"

Angel
I am looking to change the URL scheme from Forum-{url} to {url}-forum, what do I need to do in the htaccess file to accomplish this? I have tried searching through this thread, but there are 18 pages of results, and I dont know where to start.

EDIT: I am also having another issue with 404 pages... After I activated this plugin and click on "My Forum", it just redirects me to my wordpress 404 page.

Any help on either issue would be appreciated!
If you get a 404 page then your rewrite rules don't work (or a Wordpress rule gets first dibs at the URL). Either way it'll be an issue with how your rewrites are structured.

{url}-forum is possible, however you should change all other schemes then too, since otherwise any thread subject that ends with the word forum, would get an URL like Thread-something-forum, which would match {url}-forum as well, so it's a collision of URL schemes.
OK, thanks for the answer!

So for the re-write rules, can you give me a direction on where to look to make changes, or should I just hire someone on odesk to handle that for me?

If I change the syntax to {url}-forum, and the rest of them as stated above, do I still need to make changes to the .htaccess file? If so, what should I change in there?

In Admin CP -> Plugins, Google SEO should display a status, including the rewrite rules you need based on your current URL scheme settings.

As for incorporating them with Wordpress, I've never run Wordpress alongside MyBB myself, so I do not know what could be the problem exactly. If you want me to take a guess, show me your .htaccess
(2010-08-19, 10:27 PM)frostschutz Wrote: [ -> ]In Admin CP -> Plugins, Google SEO should display a status, including the rewrite rules you need based on your current URL scheme settings.

As for incorporating them with Wordpress, I've never run Wordpress alongside MyBB myself, so I do not know what could be the problem exactly. If you want me to take a guess, show me your .htaccess

I actually used the htaccess sample file that was included in the plugin folder since this was a fresh install (see attached), so it should have all the rewrite rules and everything that is required.

Now that I think of it, there are actually 2 htaccess files, one in the main site directory (/.htaccess) and the other in the forums directory (/forums/htaccess.txt). Should I combine the 2? If so, where should it be located and what should it be called?

I have attached the htaccess.txt (root.htaccess.txt) from the forum subfolder as well as the .htaccess from the root. Let me know if you see anyting weird...

Thanks so much for your help, it is much appreciated!
should be /forums/.htaccess - not htaccess.txt

the root rewrite rule matches everything without exception, so any time the forums rewrite rules don't match, you should be seeing a wordpress page. So the ErrorDocument directive is pretty much useless due to WordPress.

So if WordPress keeps interfering, you'd have to include a condition that excludes /forums/ from WordPress altogether. Something like RewriteCond %{REQUEST_URI} !(\/forums\/) before the RewriteRule . /index.php.

See if the WordPress documentation describes how to exclude specific folders, I expect that to be a not so uncommon problem...
Hello frostschutz, thank you for this great plugin! I have followed the instructions to the letter and everything works perfectly except for 1 thing. Not sure what I tweaked that the search function (search.php) stopped working. When clicking the search link the error is as follows:

Fatal error: Call to undefined function build_prefix_select() in /home/folder/public_html/share/search.php on line 1527

And on that line there is this code: $prefixselect = build_prefix_select('all', 'any', 1);

Could you please suggest something? Thank you.
You used the MyBB 1.4 functions.php with MyBB 1.6?