MyBB Community Forums

Full Version: Google SEO redirects/rewrites work and break apparently at random on Lighttpd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Heya guys Smile

Basically, here is the redirect and rewrites section of my lighttpd.conf:

url.redirect = (
	"^/forum/([^&?]*)&([^?]*)$" => "http://www.sonichentai.net/forum/$1?$2",
	"^/forum/([^&?]*)&([^?]*)\?(.*)$" => "http://www.sonichentai.net/forum/$1?$2&$3",
)
	
url.rewrite = (
	"^/forum/((?i)sitemap-([^./?]+)\.xml)(\?(.*)|)$" => "/forum/misc.php?google_seo_sitemap=$2&$4",
	"^/forum/((?i)Forum-([^./?]+))(\?(.*)|)$" => "/forum/forumdisplay.php?google_seo_forum=$2&$4",
	"^/forum/((?i)Thread-([^./?]+))(\?(.*)|)$" => "/forum/showthread.php?google_seo_thread=$2&$4",
	"^/forum/((?i)Announcement-([^./?]+))(\?(.*)|)$" => "/forum/announcements.php?google_seo_announcement=$2&$4",
	"^/forum/((?i)User-([^./?]+))(\?(.*)|)$" => "/forum/member.php?action=profile&google_seo_user=$2&$4",
	"^/forum/((?i)Calendar-([^./?]+))(\?(.*)|)$" => "/forum/calendar.php?google_seo_calendar=$2&$4",
	"^/forum/((?i)Event-([^./?]+))(\?(.*)|)$" => "/forum/calendar.php?action=event&google_seo_event=$2&$4",
)

Both appropriate modules are on (mod_redirect and mod_rewrite).

Things seem to work perfectly great but then randomly not work.

For example, on a page of poll results, some users rewrite links will work and some won't. Sometimes I'll load a page and all of the links will work, sometimes they will all be broken.

I've tried switching between the database, filesystem and xcache caches and always the problem remains. It happens on many people's computers as well, including my phone.

Any thoughts? Sad

Wave

actually, I'm not sure if this is a Lighttpd problem.

in my desperation, I tried disabling the entire plugin and removing the entire section from the lighttpd.conf file and rebooting, to stop all rewriting and save the forum.

But then ALL the links were broken - every last one.

They all just pointed to things like "thread-10202-lastpost.html" instead of the thread names (as they do "at random" normally).

Help Sad

I did it!! I did it!!

Solved! ^_^

Basically, because I am using Lighttpd, the .htaccess file needed to allow the BUILT-IN MyBB SEO URLs to work (below) was not working and therefore they were not interpreted and broke. Because the Google SEO URLs Query Limit is set to 50, after 50 requests it starts putting non-Google SEO links instead.

Quote:Enable search engine friendly URLs?

Search engine friendly URLs change the MyBB links to shorter URLs which search engines prefer and are easier to type. showthread.php?tid=1 becomes thread-1.html. Once this setting is enabled you need to make sure you have the MyBB .htaccess in your MyBB root directory (or the equivalent for your web server). Automatic detection may not work on all servers. Please see the MyBB Docs for assistance.

Because I have the Google SEO plugin installed anyway, I simply disabled this feature and now everything works like clockwork!

Hoorayyyyy! ^_^

Wave Smile