MyBB Community Forums
[How To?] SEO friendly urls - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] SEO friendly urls (/thread-164126.html)



SEO friendly urls - DanielM - 12-13-2014

Hi, MyBB has seo friendly urls in this structure:
www.example.com/thread-1.html
I want to make the url like IPB:
www.example.com/1-Hi-World.html

It is possible without Google SEO plugin?
I'm building plugin for SEO and I don't know how to do it.
Thanks for answers Smile


RE: SEO friendly urls - Nathan Malcolm - 12-13-2014

Quote:It is possible without Google SEO plugin?

Put simply, no.


RE: SEO friendly urls - DanielM - 12-13-2014

(12-13-2014, 02:09 PM)Nathan Malcolm Wrote:
Quote:It is possible without Google SEO plugin?

Put simply, no.

Google SEO makes it somehow, so there is a way to do it without it. It doesn't matter if only htaccess or with some php. I want to do it no matter how in separate plugin.


RE: SEO friendly urls - Nathan Malcolm - 12-13-2014

Well if you want to create another plugin with the same functionality, take a look at the code from Google SEO. It's not as simple as copying a few lines of code. That's why there's a whole plugin for it.


RE: SEO friendly urls - DanielM - 12-14-2014

(12-13-2014, 02:51 PM)Nathan Malcolm Wrote: Well if you want to create another plugin with the same functionality, take a look at the code from Google SEO. It's not as simple as copying a few lines of code. That's why there's a whole plugin for it.

the Google SEO plugin is huge and I can't find the part that responsible on this


RE: SEO friendly urls - DanielM - 12-15-2014

someone?


RE: SEO friendly urls - DanielM - 12-16-2014

someone?....


RE: SEO friendly urls - frostschutz - 12-16-2014

The Google SEO plugin hooks into inc/functions.php::get_thread_link() and returns a different URL. The old Spicefuse SEO plugin hooks into the output and uses regular expressions to collect all thread links in the output, and replace them with different ones. Either one has to query thread subjects from the database in order to be able to place them in the URL.

http://www.example.com/1-Hi-World.html

Although I recommend sticking to the default URL style of Google SEO, it can emulate this one, to some degree...

Enable force uniquifier, {uniquifier}{separator}{url} and thread URL {url}.html will give you 1-Hi-World.html; if you treat the number as prefix, a rewrite rule like ^([0-9]+)-.*\.html showthread.php?tid=$1 [L,QSA] should work.

Although since the force uniquifier is a global setting, you will also end up with u1-User, f1-Forum, ...

If it's about mimicking URLs from your old board, you're bound to fail, and you should rather think about how to redirect them properly.