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.
Nope, I have all the Google SEO features rolling. You can see the link provided in my last edit.

This is what I currently have in Punctuation characters: # $%&*/;<=>\^_`{|}~

There are replaced by underscore. I'm still polishing this up as I want only minimal characters (=disallowed MediaWiki ones) be removed. This minimizes the code needed in MediaWiki's templates to do an automatic link.

Most importantly it all works just fine atm Smile
See my edit as well... *shrug* If it works, great, so it seems you didn't have a problem in the first place. Smile
Okay, just noticed: my browser changed from Firefox (home) to Chrome (work). Thus .htaccess didn't change anything after all, Firefox does show it as %3A while Chrome displays it as :

So now I'm caught by browser differences! I don't know if there should be a rule to how these address bar urls should work.

It's not nice doing stuff @ work with very limited time. Oh well, have to take yet another look at the problem once I'm home. I guess Google SEO does do something after all. The B switch in .htaccess is still important though, had to apply the same to get ? character working in MediaWiki page titles so that I didn't get a redirection to a page that didn't exist.

Luckily this isn't a world collapsing issue, just a visual annoyance I'd like to get fixed for consistent urls on the whole site.
Can i remove the "user", "thread" etc from the urls?

I know how to remove it, i just want to know, it works correctly or not. Thx!
frostshutz: after a few tests I ended up changing redirect.php in this way:

// line 206
$target = $settings['bburl'].'/'.str_replace('%3A', ':', $target);

A very dirty hack but the end result url is now correct. It does add an extra redirection header on each page load, which I don't like, but the SEO engine seems to dislike absolute linking a lot (adding stuff such as /keskustelu/ in a link messes things up much more than I initially expected).

Also, MediaWiki does indeed always use absolute links, so the links are in format "/wiki/NamespaceToungueage" and not "Namespace%3APage" – should always check instead of relying on memory!


Valaki: I think not, there would be no way the link could be detected by Google SEO. Thus it woudn't know the context of the link text. I guess it could be done for one thing such as thread titles, but for two or more it would be impossible.
Second post "just in case": I tested what I said in my last post. It works! I dropped what I had for threads ("Thread-" or in my case "Aihe:") in Google SEO URL settings so it just says {url} in the field. Then in .htaccess I moved threads to be the last rule:

	# Google SEO URL Threads:
	RewriteRule ^([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC,B]

I guess if it was first then all the other rules would match to be Threads, I did the move knowing about this possibility beforehand. So far I haven't noticed any issues.

Thanks for the idea, Valaki! Smile
(2010-11-29, 02:45 PM)Valaki Wrote: [ -> ]Can i remove the "user", "thread" etc from the urls?

No, you can't - there needs to be something in the URLs that identifies them as a user profile, thread, forum etc. You can use something other than User-, for example you could just use u- t- f- etc.

(2010-11-29, 03:23 PM)Merri Wrote: [ -> ]frostshutz: after a few tests I ended up changing redirect.php in this way:

// line 206
$target = $settings['bburl'].'/'.str_replace('%3A', ':', $target);

A very dirty hack

The ramifications of that hack are:

- every link in your forum will be redirected
- every link in your sitemap will be redirected (thereby breaking the sitemap)

It's not a good solution. At the very least you should hack sitemap.php as well to link to : instead of %3A directly. Then if possible, add another hack that filters the output HTML, replacing relative links with href="./originalurl" with : instead of %3A.

Before you get any ideas, no you can't add ./ or any other path to the URL scheme, because it's used for both relative and absolute links, so absolute links (such as in mails and again in the sitemap) would suddenly contain /./ or // which is wrong and unprofessional...

(2010-11-29, 03:23 PM)Merri Wrote: [ -> ]Also, MediaWiki does indeed always use absolute links, so the links are in format "/wiki/NamespaceToungueage" and not "Namespace%3APage" – should always check instead of relying on memory!

Yes, MediaWiki gets away with it because it's aware of the problem and at the same time it controls all the links. Google SEO unfortunately has no influence over how MyBB puts links together, so it can't coerce MyBB into making absolute instead of relative links. At least not in a way that works for everything. You can always make dirty hacks if you absolutely want to do that, in your own forum. Just don't expect them to fix all issues.

(2010-11-29, 03:23 PM)Merri Wrote: [ -> ]I guess if it was first then all the other rules would match to be Threads, I did the move knowing about this possibility beforehand. So far I haven't noticed any issues.

Yes, but if there's a conflict, it usually goes both ways. There are some people who allow anything for threads, but then if someone makes a thread that starts with Forum- in the subject, it suddenly stops working because the URL ends up being /Forum-Something which is then interpreted as a forum url... thus the thread link is broken.

I can't do more than tell you what works best; don't blame me if your forum breaks when you go a different route.
By default the forum displays the thread numbers also, but when we use seo urls, they are changed to the name of thread title. Now, how can we display thread numbers also in google seo urls?
(2010-12-01, 04:45 AM)1master1 Wrote: [ -> ]By default the forum displays the thread numbers also, but when we use seo urls, they are changed to the name of thread title.

That's kind of the whole point of the plugin...

(2010-12-01, 04:45 AM)1master1 Wrote: [ -> ]Now, how can we display thread numbers also in google seo urls?

The only option currently is the force uniquifier setting in the URL settings, however that will add the ugly number to all URLs, not just the threads.
no problem, thanks
i try google seo url but it not working in my site, url has change but when i go to the thread i got answer: "invalid forum". i already write in .htaccess and replace functions.php from page one of this thread. it work for forum and subforum only, others no. can you help me about the problem?