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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

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

Post 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? ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Menu home page links to home instead of root

Post 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)
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Menu home page links to home instead of root

Post 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
Post Reply

Return to “CMSMS Core”