|
|
|
|
Re: hey guys, any seo urls plugins? [message #162570 is a reply to message #162569] |
Thu, 10 June 2010 06:49   |
Ernesto
 Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
I was hoping there wouldnt have to be a "manual" in the merge hehe - Anyhow, just figured out that SEO URLS can co-exist with regular URLs so slowly merging them together.
However, something I just realized is that FUDs SEO URLS arent very attractive, since they do not list a topic title in the URL.
Example:
http://www.searchenginejournal.com/seo-best-practices-for-url-structure/721 6/
I *WAS* gonna say, see how it doesn't care if you edit the title, but actually it does care hehe so poor example.
Aaaanyway, wouldn't sort of the whole point with the SEO to have the topic title in the URL? As a not-used variable if nothing else?
IE:
fudforum.org/forum/index.php/t/21102/hey-guys,-any-seo-url-plugins?/
Where the last part, the title, is ignored by the system, it only reads the threadID like usual.
Hrmm, maybe one should add in the thread.php.t a new variable called like "thread_title_SEO" and then format it somehow by replacing spaces with "-"'s and then just append it to the {SECTION: whatever_lnk} templates? Shouldn't that work and make search engines index your pages better?
|
|
|
|
|
Re: hey guys, any seo urls plugins? [message #162597 is a reply to message #162577] |
Tue, 15 June 2010 19:52   |
Ernesto
 Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
I ended up doing this and put it in thread.php.t and index.php.t (Guess it could have been put in some other file that is included in both those, but I am a worthless coder, so I dont care):
/* begin URL SEO HACK */
$forum_title_SEO = str_replace(" ","-",$r[10]);
$forum_title_SEO = strtolower($forum_title_SEO);
$forum_title_SEO = preg_replace('/[^a-z0-9_]/i', '-', $forum_title_SEO);
$forum_title_SEO = preg_replace('/_[_]*/i', '-', $forum_title_SEO);
$forum_title_SEO = str_replace('---', '-', $forum_title_SEO);
$forum_title_SEO = str_replace('--', '-', $forum_title_SEO);
$forum_title_SEO = str_replace('-s-', 's-', $forum_title_SEO);
$forum_title_SEO = str_replace("%","",$forum_title_SEO);
$forum_title_SEO = str_replace("/","",$forum_title_SEO);
There is also a problem if the thread title starts with numbers, so I also had to edit users.inc.t:
We just add an isnumeric check (should have been there from the start imo!)
case 't': /* view thread */
$_GET['t'] = 0;
$_GET['th'] = $p[1];
if (isset($p[2])&&is_numeric($p[2])) {
$_GET['start'] = $p[2];
if (!empty($p[3])) {
$_GET[$p[3]] = 1;
}
}
break;
switch ($p[0]) {
case 'm': /* goto specific message */
$_GET['t'] = 0;
$_GET['goto'] = $p[1];
if (isset($p[2])) {
$_GET['th'] = $p[2];
if (isset($p[3])&&is_numeric($p[3])) {
$_GET['start'] = $p[3];
if (is_numeric($p[3])) {
$_GET['t'] = 'msg';
unset($_GET['goto']);
}
or well, for correctness sake, everywhere where it checks for stuff that's supposed to be only numbers - This way, things will not get messed up if a thread is called "12 monkeys"
|
|
|
|
|
|
|
|