Page 1 of 1

[solved] Menu home page links to home instead of root

Posted: Tue Apr 15, 2014 2:34 pm
by paulbaker
In all the CMSMS sites I have created myself, the home page of the website (alias "home") always shows in the menu as simply "/", for example clicking on the Home page on the menu takes you to:
"http://www.example.com/

I don't recall doing anything special for this to happen - it just does.

However, on a CMSMS website that I now look after the menu is linking to this URL when you click on the Home page link:
"http://www.example.com/home

Content-wise this is fine. It shows the same as root (/). But Google sees this as duplicate content.

How can I get the menu to link to the root (/) not /home?

I have compared all sorts of settings between this and another site and I cannot see anything obvious that is causing it.

In my config.php I have:

Code: Select all

$config['root_url'] = 'http://www.example.com';
The menu used on the site is the standard nav-accordion.tpl but I don't believe that makes any difference.

And - related - I have this in the template of all pages:

Code: Select all

{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}
On the home page this produces a URL of:
"http://www.example.com/home

and yet the exact same canonical code on another site (same CMSMS version even) produces a URL like:
"http://www.example.com/

Anybody? ???

Re: Menu home page links to home instead of root

Posted: Tue Apr 15, 2014 2:41 pm
by calguy1000
A: System Info not provided
B: Make sure your 'home' page is actually set as the default page
C: Do a system verification, make sure you're not dealing with a hacked install.
The reason is: If that the system is programmed to return just the root url for the default page.
D: Check your .htaccess for hacky stuff in there there
(that would cause requests to mysite.com/ to redirect to mysite.com/home)

Re: Menu home page links to home instead of root

Posted: Tue Apr 15, 2014 2:58 pm
by paulbaker
calguy1000 wrote:B: Make sure your 'home' page is actually set as the default page
Thanks Robert for your swift reply. You got it spot on. Somehow, there was no default page set - no green tick under "Default" in the list of Pages. I don't know how that could have happened. I clicked it and we're now all sorted, / link in menu and / canonical link.

Thanks again! ;D