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.
Thank you. Awesome work too, I just can't keep saying that. Smile
Hi there. Great plugin but I got a bit of an issue with the rewrites.

Not sure if you can help me with this but on my board, I have virtual directories set up (such as forum/forum-name.html / thread/thread-name.html) and they work perfectly - except with clicking threads from the index. For some really odd reason, it duplicates "/thread/" as it redirects from ?action=lastpost and throws a 404. Removing one of the duplicates works as it should but I can't figure out why it's doing that.

My board is http://board.vaulthunters.com/
Did you set a base as described in the documentation?
(2012-10-11, 12:55 PM)frostschutz Wrote: [ -> ]Did you set a base as described in the documentation?

I did, yes. As I said, regular links work perfectly, it's just when clicking on threads from the board index.

For instance, http://board.vaulthunters.com/thread/14-...nters.html works just fine but board.vaulthunters.com/thread/14-welcome-hunters.html?action=lastpost will redirect to board.vaulthunters.com/thread/thread/14-welcome-hunters.html?pid=92#pid92
Well. Now you know why I don't recommend using directory structure.

Basically you have three options there.

1) change the url scheme to something that doesn't involve /
2) change the rewrite rules to accept thread/thread/, e.g. thread/(thread/)* and hope that Google SEO Redirect will punch it back to a single /thread/ with an additional redirect
3) change MyBB code to not use relative Location: headers which circumvent the <base> tag.

There's nothing I can do to fix this in the plugin. When someone calls get_post_link, get_thread_link(), etc. I can't tell what this is going to be used for. So I can't just return nothing if it's meant for a Location tag.

If you want to change code, find all header("Location:" that use get_*_link() and put {$mybb->settings['bburl']}/ in front of em.

e.g.
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
to
header("Location: {$mybb->settings['bburl']}/".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
(and all others like it)

When MyBB makes its source code public again I might send a patch for this their way and see if they're going to apply it. But don't keep your fingers crossed...
I tried the 3rd option and that seemed to have fixed the duplicate "thread" and redirects nicely.

Thanks, frostschultz!

Got another question. How do you omit separator for contractions in the URL, such as "don't" or "I'm"? To me, it looks kinda ugly reading "i-m-blah-blah" instead of "im-blah-blah".
I simply cannot get this to work.. I have tried copying/pasting the SEO code stuff into my .htaccess.txt

I have tried everything

Using Godaddy hosting and they claim that the rewrite function is standard on their servers...

I am just lost and don't know what else I can do to fix this issue..

Any help from anyone would be greatly appreciated.
Make sure it's labeled .htaccess and not htaccess.txt. In your case, remove the .txt and it'll work.
I enable the uniquifier option, but after turning it off it wont go away for one of the sections Huh

If you go to my forum, you can see that the Current Nintendo Generations section and threads in that section (in the sidebar) still have the ID at the end of the URL and are giving a 404 error, but the other sections don't. I'm a bit stuck.

EDIT: Nevermind, it seems to be fixed... I think.
(2012-10-19, 10:10 AM)YoshiOlly Wrote: [ -> ]I enable the uniquifier option, but after turning it off it wont go away for one of the sections Huh

It updates the URLs only when you actually access them.

So a thread or forum or category that hasn't been viewed since the change, will still show the old URL.

Also there is an additional URL cache for index/portal (by default, configurable) so it might show old URLs for a while longer there.