1
sudhaker
SEO (Search Engine Optimization) In Action
  • 2005/8/28 22:03

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


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

$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
............

2
WarDick
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 3:49

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


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......

3
sudhaker
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 4:02

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


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

4
WarDick
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 4:04

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


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

5
sudhaker
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 4:15

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


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
............

6
LazyBadger
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

7
carnuke
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 5:17

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


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.php?forum=10&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.
hhttp://houseofstrauss.co.uk Resource for alternative health and holistic lifestyle
search xoops

8
MadFish
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 5:19

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


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...

9
sudhaker
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 5:26

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


@ 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
............

10
sudhaker
Re: SEO (Search Engine Optimization) In Action
  • 2005/8/29 5:47

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


@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
............

Login

Who's Online

295 user(s) are online (193 user(s) are browsing Support Forums)


Members: 0


Guests: 295


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits