xoops forums

sudhaker

Not too shy to talk
Posted on: 2005/8/28 22:03
sudhaker
sudhaker (Show more)
Not too shy to talk
Posts: 117
Since: 2003/2/6 2
#1

SEO (Search Engine Optimization) In Action

Hi Xoopser,

SEO is in action at my site http://thej2ee.com It is a great to have feature for XOOPS community and I'm sure that everyone will like to see its support in the CORE.

I found one hack, which was doing ob_start and huge regex replacement to generate URL like http://thej2ee.com/software/cat/130/ . This approach lack in putting related words in URL itself.

So I worked on cloned module to get more SE attention. And now it is generating URLs like

http://thej2ee.com/software.cat.130/web-frameworks.html
http://thej2ee.com/software.link.1488/struts.html

The base software module was a perfect clone of mylinks as mentioned here http://xoops.biz/x7/modules/myhacks/index.php?id=3 .

For "code junkies", I am listing the highlights.

function software_sefriedly_url($id$type$title="") {
        
$words preg_split('/[^0-9a-z]+/'strtolower($title));
        return 
XOOPS_URL."/software.$type.$id/".implode($words'-').'.html';
}


and

/.htaccess
RewriteEngine   On
RewriteBase     
/
RewriteRule     ^software.link.([0-9]+)/     software.php?lid=$1
RewriteRule     
^software.cat.([0-9]+)/      software.php?cid=$1


and

/software.php
<?php

$newUrl 
'modules/software/index.php';
if (
is_numeric($_GET['lid'])) {
    
$newUrl 'modules/software/singlelink.php';
} else 
if (
is_numeric($_GET['cid'])) {
    
$newUrl 'modules/software/viewcat.php';
}

$PHP_SELF '/'.$newUrl;

$_ENV['PHP_SELF'] = $PHP_SELF;
        
$_SERVER['SCRIPT_NAME'] = $PHP_SELF;
$_SERVER['PHP_SELF'] = $PHP_SELF;

$_SERVER['REQUEST_URI'] = $PHP_SELF '?' $_SERVER['QUERY_STRING'];

chdir(dirname($newUrl));
include(
$newUrl);

exit;
?>
Sudhaker Raj
............

WarDick

Just can't stay away
Posted on: 2005/8/29 3:49
WarDick
WarDick (Show more)
Just can't stay away
Posts: 890
Since: 2003/9/13
#2

Re: SEO (Search Engine Optimization) In Action

Those are nice looking URL's. I am having a hard time understanding what's going on. Does this work with any module or just the mylinks.
Urging XOOPS to be the Best It Can Be.
Richard......

sudhaker

Not too shy to talk
Posted on: 2005/8/29 4:02
sudhaker
sudhaker (Show more)
Not too shy to talk
Posts: 117
Since: 2003/2/6 2
#3

Re: SEO (Search Engine Optimization) In Action

I did modify the code to make it 'mylinks' SE friendly and clonned it with 'software' name.
Sudhaker Raj
............

WarDick

Just can't stay away
Posted on: 2005/8/29 4:04
WarDick
WarDick (Show more)
Just can't stay away
Posts: 890
Since: 2003/9/13
#4

Re: SEO (Search Engine Optimization) In Action

Have these URL's increase traffic to your site?
Urging XOOPS to be the Best It Can Be.
Richard......

sudhaker

Not too shy to talk
Posted on: 2005/8/29 4:15
sudhaker
sudhaker (Show more)
Not too shy to talk
Posts: 117
Since: 2003/2/6 2
#5

Re: SEO (Search Engine Optimization) In Action

Good question. I don't have definite answer to this, but google obviously don't like to index URLs like these,

http://site/some.php?id=1
http://site/some.php?id=2
http://site/some.php?id=3
http://site/some.php?id=4

Also when struts word is present in URL, it should have better SE ranking than having it somewhere only on pages. I re-launched this site this weekend itself and should see result in few weeks.
Sudhaker Raj
............

LazyBadger

Home away from home
Posted on: 2005/8/29 4:36
LazyBadger
LazyBadger (Show more)
Home away from home
Posts: 1187
Since: 2004/6/7 9
#6

Re: SEO (Search Engine Optimization) In Action

Quote:

sudhaker wrote:
Good question. I don't have definite answer to this, but google obviously don't like to index URLs like these,

http://site/some.php?id=1
http://site/some.php?id=2
http://site/some.php?id=3
http://site/some.php?id=4

I had to say, that it's one of myths. Google (and other engines) work nicely with parametrized URL and haven't any troubles with it
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

carnuke

Home away from home
Posted on: 2005/8/29 5:17
carnuke
carnuke (Show more)
Home away from home
Posts: 1955
Since: 2003/11/5
#7

Re: SEO (Search Engine Optimization) In Action

My experience is that the problem is with query strings in the URL. Most search engines will not index a link with a query string and there is a range of reasons for this. Google however does. I have also seen Yahoo, hotbot MSN and a few other minor S/Es parse query strings without a problem. Even long strings like

https://xoops.org/modules/newbb/reply. ... 0&topic_id=40764&viewmode
=flat&order=ASC&start=0&post_id=178696

are not a problem for google as any search will reveal. We have seen a few short URL hacks before, but none of theme was completely successful for every module.
http://houseofstrauss.co.uk Resource for alternative health and holistic lifestyle
search xoops

MadFish

Friend of XOOPS
Posted on: 2005/8/29 5:19
MadFish
MadFish (Show more)
Friend of XOOPS
Posts: 1056
Since: 2003/9/27
#8

Re: SEO (Search Engine Optimization) In Action

Quote:
I had to say, that it's one of myths. Google (and other engines) work nicely with parametrized URL and haven't any troubles with it


This is my experience also - I have never had any problems with having my pages indexed. I am curious as to how you can tell if optimisation has improved the situation or not?

It seems useful for making URLs more human-friendly though...

sudhaker

Not too shy to talk
Posted on: 2005/8/29 5:26
sudhaker
sudhaker (Show more)
Not too shy to talk
Posts: 117
Since: 2003/2/6 2
#9

Re: SEO (Search Engine Optimization) In Action

@ LazyBadger - You are right about parameterized URL. My mistake.

Robots treat h1 and h2 tags with higher preference than other tags, isn’t it? Page title is having even higher preference. So what if we have keywords in URL itself?

My feeling is that, having

http://thej2ee.com/software.cat.130/web-frameworks.html
http://thej2ee.com/software.link.1488/struts.html

is always better than

http://thej2ee.com/software.cat.130/
http://thej2ee.com/software.link.1488/

which is better than

http://thej2ee.com/software/cat/130/
http://thej2ee.com/software/link/1488/

which is better than

http://thej2ee.com/module/software/viewcat.php?cid=130
http://thej2ee.com/module/software/singlelink.php?lid=1488

Will do some more research to find out the truth. Also, I should see results in few weeks.
Sudhaker Raj
............

sudhaker

Not too shy to talk
Posted on: 2005/8/29 5:47
sudhaker
sudhaker (Show more)
Not too shy to talk
Posts: 117
Since: 2003/2/6 2
#10

Re: SEO (Search Engine Optimization) In Action

@carnuke

I learned few things from older short URL hack but did not like their ob_start approach. Also their huge regex replacemnet will add more to the server load.

My short URL hack is optimized and is very much module specific. I will be doing similar hack for other modules as well (which I will use for my sites - tinycontent, smartsection, smartfaq...etc). I will also try to convince module developer to merge this hack else I will maintain my own fork.

In the final shape, a constant defined in mainfile.php should change the behavior of any shortURL aware module. This will be able to serve regular URL and short URL both based on server's capability and webmaster's wish.

Entry in mainfile.php can be something like this:

define('XOOPS_SEO_ENABLED', 1);
Sudhaker Raj
............