Seo optimization and clean url

A place for general not CMSimple related discussions
Post Reply
sareide
Posts: 21
Joined: Sat Apr 07, 2012 1:26 pm

Seo optimization and clean url

Post by sareide » Thu Apr 26, 2012 8:56 am

Hi all
I've developed a six multilanguage site with cmsimple_hx, but google seems to have difficuties about indexing site pages.
I' have translated all pages to their languages and used sitemapper plugin to create sitemap files (the main sitemap and the six for each language).

but I have realized that there are 0 URL in web index. For istance:
Sitemap Status URLs in web index
/sitemap-de.xml 0
/sitemap-en.xml 0
/sitemap-es.xml 0
/sitemap-fr.xml 0
/sitemap-it.xml 13
/sitemap-ru.xml 0
/sitemap.xml 13

Any suggestion? pages are different so there is no reason for googlebot to skip them.

I read about clean urls; does someone got a solution modifying cmsimple php?

thanks in advance
sareide

cmb
Posts: 13260
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Seo optimization and clean url

Post by cmb » Thu Apr 26, 2012 12:00 pm

Hi sareide,
sareide wrote:/sitemap-de.xml 0
/sitemap-en.xml 0
/sitemap-es.xml 0
/sitemap-fr.xml 0
/sitemap-it.xml 13
/sitemap-ru.xml 0
/sitemap.xml 13
That's pretty strange! sitemap.xml should be a sitemap index file containing only the <sitemap> elements for the 6 languages. The sitemap-XX.xml files should contain the <url> elements for each respective page (i.e. 13 <url>s). This works fine on my website (just yesterday I've started a german translation):
http://3-magi.net/sitemap.xml
http://3-magi.net/sitemap-en.xml
http://3-magi.net/sitemap-de.xml

It seems as on your site only sitemap-it.xml is correct, and that all other languages are written to sitemap.xml instead of their respective sitemap-XX.xml files. Can you verify this, by looking at the content of sitemap-it.xml and sitemap.xml? This might be helpful for me to find out what's wrong. BTW: I assume the primary language of the website it IT. Is that correct?
sareide wrote:I read about clean urls; does someone got a solution modifying cmsimple php?
There is an article about that in the CMSimple wiki. But the solution has some documented limitations. And I'm not sure, if it will work with recent versions of CMSimple_XH.

OTHO: I didn't notice any problems with the CMSimple URLs. E.g. try googling for "sitemapper_xh".

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

sareide
Posts: 21
Joined: Sat Apr 07, 2012 1:26 pm

Re: Seo optimization and clean url

Post by sareide » Thu Apr 26, 2012 5:23 pm

Hi Christoph
I have seven sitemap files creates according to sitemapper plugin documentation: the main sitemap is the following:
<sitemapindex xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap ... temapindex>

I have also six file, one for each different language. But Now I have opened these files. The italian one, corresponding to the cms language setting is correct. The other ones are wrong, since it seems that the plugin doesn't use the country prefix. That is to say, my pages in italian have these urls: http://www.XXXXXXXXXXX.it/?h1_level_page_title (if 1st level) or http://www.XXXXXXXXXXX.it/?h1_level_pag ... page_title (for lower level). The pages for other countries are http://www.XXXXXXXXXXX.it/en/?h1_level_page or http://www.XXXXXXXXXXX.it/en/?h1_level_ ... page_title .
But I realized that sitemapper_hx plugin generates other language urls without the country prefix (for istance en). Otherwise the url is http://www.XXXXXXXXXXX.it/?h1_level_pag ... page_title with en missing.
that's way Google counts 0 urls. I have found that this behaviour is present in your site too.
If you look at your sitemaps http://3-magi.net/sitemap.xml, http://3-magi.net/sitemap-en.xml , http://3-magi.net/sitemap-de.xml you could realize that the country prefix /en/ /de/. For xxample, if you move the mouse over the news title menu "NEWS" (on the left side) you see http://3-magi.net/de/?News. But if you look for this url inside the file you could read "http://3-magi.net/?News" (missing /de/.
I thik that there is something wrong inside my installation or inside plugin behaviour.

Only a question. How your site urls are withe form "http://3-magi.net/de/?Hallo/Zweisprachig" instead of "http://3-magi.net/de/?Hallo:Zweisprachig". Do i have to change some parameter?
thanks ins advance for you attention.
sareide

sareide
Posts: 21
Joined: Sat Apr 07, 2012 1:26 pm

Re: Seo optimization and clean url

Post by sareide » Thu Apr 26, 2012 5:43 pm

Hi
I think that the error is there:
<loc>'.htmlspecialchars('http://'.$host.CMSIMPLE_ROOT.'?'.$u[$i]).'</loc>'."\n";
but the $suffix seems to be missing.
Do you think that this the reason?

CMSIMPLE_ROOT is the string http://www.xxxxx.it

sareide

cmb
Posts: 13260
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Seo optimization and clean url

Post by cmb » Thu Apr 26, 2012 5:58 pm

Hi sareide,
sareide wrote:but the $suffix seems to be missing.
Do you think that this the reason?
Yes, that's exactly the point: it's a bug in Sitemapper_XH! Thanks for pointing this out. I'll release a bugfix ASAP (probably tomorrow).

It's probably enough to replace CMSIMPLE_ROOT in this line with $sn, and to add $sn to the global declaration at the beginning of the function. But I'll test this more thouroughly later.
sareide wrote:Only a question. How your site urls are withe form "http://3-magi.net/de/?Hallo/Zweisprachig" instead of "http://3-magi.net/de/?Hallo:Zweisprachig". Do i have to change some parameter?
You can change this in CMSimple's configuration: it's called "uri seperator". It can be set to any reserved character in URLs. The / looks quite nice (even it doesn't give a "clean" URL actually).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

sareide
Posts: 21
Joined: Sat Apr 07, 2012 1:26 pm

Re: Seo optimization and clean url

Post by sareide » Fri Apr 27, 2012 11:06 am

perharps the error could avoided with

inside: function sitemapper_subsite_sitemap() {

substitute the row .' <loc>'.htmlspecialchars('http://'.$host....... with

$country_root = CMSIMPLE_ROOT;
if ($cf['language']['default'] != $sl) { $country_root = CMSIMPLE_ROOT.$sl.'/';}


$res .= ' <url>'."\n"
.' <loc>'.htmlspecialchars('http://'.$host.$country_root.'?'.$u[$i]).'</loc>'."\n";
best regards
sareide

cmb
Posts: 13260
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Seo optimization and clean url

Post by cmb » Fri Apr 27, 2012 11:32 am

Hi sareide,
sareide wrote:perharps the error could avoided with
Yes, that's possible too. But the definition of CMSIMPLE_ROOT is:

Code: Select all

define('CMSIMPLE_ROOT', str_replace('index.php', '', str_replace('/' . $sl . '/', "/", $sn))); 
So I might as well use $sn in the first place (stripping a possible index.php). I've already made that change and now the generated URLs are correct.

But while testing this, I found another issue: if a new page is added in the editor (not pagemanager or menumanager), there's a temporary desynchronization of content and pagedata, which is catered for by a redirection only after the plugins were processed. So in this case the info in sitemap-XX.xml is wrong until the new page is edited and saved again. It's not impossible to take care for that in Sitemapper_XH, but it wouldn't be a clean solution IMO. The best solution is, if the sitemap.xml and sitemap-XX.xml were not created at all, but the sitemaps will be available by a particular GET request. I had this solution in my mind since quite a while already as it will solve the problem, that possibly other plugins will change the page structure of the site (currently only saving from the editor and changes in Pagemanager or Menumanager will trigger the creation of the sitemaps). But as this change might introduce other bugs, I will not release it as patch of version 1.

So the roadmap is: I'll release the simple bugfix as given above rather soon (probably in a few hours). The dynamic availability of the sitemap will be possible in version 1.1, or more probably as part of another plugin.

Christoph

PS: The patch is available: http://www.cmsimpleforum.com/viewtopic. ... 733#p27733.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply