improving pagerank of default page

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
tamlyn

improving pagerank of default page

Post by tamlyn »

It bothered me that the menu system linked to my home page (www.example.com) as www.example.com/home.html so I modified the getURL() method of the content class so that if mDefaultContent is true it just returns root_url. This improves the page ranking of the home page as it now appears as just one page rather than two separate pages. Someone who knows cmsms better than me will have to tell me if this breaks anything but in my limited testing it seems to work:

in the getURL() method of the ContentBase class in lib/classes/class.content.inc.php (line 1219 in v0.12) change this

Code: Select all

    if ($config["assume_mod_rewrite"] && $rewrite == true)
to this

Code: Select all

    if($this->mDefaultContent) 
    {
      $url = $config["root_url"];
    } 
    elseif ($config["assume_mod_rewrite"] && $rewrite == true)
jelle

Re: improving pagerank of default page

Post by jelle »

Does it really matter if the url (and only the url) is different? As far as I know, google will recognise the duplicate content. I would assume that google'd be smart enough to treat it as one page if it is within the same domain. But I might be wrong. If it is as you say it is a usefull hack.
tamlyn

Re: improving pagerank of default page

Post by tamlyn »

Hmmm. I'm sure some of my pages used to have different page ranks on the / and /home.html variations but checking now they're all the same. Maybe they've updated the algorithm or perhaps my  pagerank checker is playing tricks on me.

I think it looks kinda neater anyway.
amygdela

Re: improving pagerank of default page

Post by amygdela »

Google recently edited the pageranks for websites. perhaps it was just that?
Post Reply

Return to “Developers Discussion”