My home page is based off of a custom page built using panels.

When I am at my site root the canonical url printed in the source code is to the panel page a not the base url

ie it reads:
somedomain.com/home-page

instead of:
somedomain.com

CommentFileSizeAuthor
#17 nodewords-n767764-17.patch1.99 KBdamienmckenna

Comments

Anonymous’s picture

Title: Canonical tag for home page should be base url » Token for the front page URL should return the base URL

The meta tag for the canonical URL accepts <front> as value.

I will change the description for the canonical URL to report that <front> is an accepted value, remove the tokens for the front page URL, and change the code for generating the tokens [metatags-normal-url], and [metatags-url-alias] to consider the case of the front page URL.

locomo’s picture

great thanks

worked for me!

Anonymous’s picture

Status: Active » Fixed

I changed the code, and committed it in Drupal.org repository.
Thanks for your report.

locomo’s picture

Priority: Normal » Critical
Status: Fixed » Active

I'm confused - in the most recent dev version the Front Page settings under "Specific Meta Tags" are no longer available .. so there is no way to set for the home page..

I think the home page is a "special page" and I would lobby for returning a dedicated area to set meta tags for this page

there is now no way to set tags for the home page and the custom page tags are not working

Anonymous’s picture

The token code has been already changed to return the correct URL for the front page; there is no need to set the canonical URL for the front page specifically.

locomo’s picture

its not working though.. check out:
http://omaha.net/

also, how do we now set meta description and meta keywords fro the home page??

damienmckenna’s picture

Issue tags: +v6.x-1.12 blocker

Tagging this. We want the next release to be rock solid, so if you have some time please help test the v6.x-1.x-dev release to see if all of the above issues are resolved.

damienmckenna’s picture

I think the question is: what should the default value for the Canonical URL meta tag actually be to provide the correct result?

Results of using various tokens provided by the token.module as the canonical URL with the site_frontpage value set to "homepage":

damienmckenna’s picture

Could this be a problem in token.module itself?

dave reid’s picture

@locomo: To answer your question about setting frontpage meta tags, you have to make sure the "Meta tags for custom pages" module is enabled, then go to admin/content/nodewords/custom/add and use the path '' and set your meta tags as desired.

dave reid’s picture

@DamienMcKenna: If you're wanting to use a canonical URL for frontpage, you should probably be using the [site-url] token, not the [current-page] tokens.

dave reid’s picture

Category: bug » support
Status: Active » Fixed

The answer to the original problem is to use the [site-url] token as your canonical token's value. Hence, there's no bug here.

damienmckenna’s picture

Status: Fixed » Needs work

Maybe this just needs #901764: Re-add easy support for front page meta tags to resolve the stupidity of getting this to work?

I also also under the mistaken impression that GlobalRedirect kicked in to change the path provided by drupal_get_path_alias(), but it only works on the actual page load. Should that be changed?

damienmckenna’s picture

For v6.x-1.12 should we add a note to the README.txt to explain it? it just sucks how this currently works right now :-\

dave reid’s picture

No global redirect only works on the actual page request, not on all links generated. I think we need to re-add the easy front-page meta tag sub-tab for 6.x-1.12. It should be fairly easy to do.

dave reid’s picture

Priority: Critical » Normal
Status: Needs work » Fixed
damienmckenna’s picture

Status: Fixed » Needs work
StatusFileSize
new1.99 KB

Lets change the canonical field's description to indicate what the recommended defaults are:

Canonical URLs are used from the search engines, and allow them to not report duplicate titles for HTML pages that are accessible from different URLs. Canonical URLs that point to a different domain are normally not accepted. This meta tag supports tokens. The recommended value for the front page is "[site-url]", the recommended default for other pages is "[current-page-path-raw]".
damienmckenna’s picture

I also created a related issue (#958918: [site-url] canonical tag token should not have the trailing slash trimmed) to stop the homepage's canonical URL needlessly stripping the trailing slash.

damienmckenna’s picture

Status: Needs work » Needs review
dave reid’s picture

Actually I discover that also using <front> works really, really well in the frontpage context.

damienmckenna’s picture

@davereid: if you added a HTML tag it didn't come through?

damienmckenna’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Issue tags: -v6.x-1.12 blocker

Bumping this to 6.x-2.x as 6.x-1.x no longer supports Tokens.

Lumas71’s picture

I've tried unsuccessfully my site's domain name, ‹front› and [site-url]. All I get is an error message "invaild base url". Very frustrating!!!

damienmckenna’s picture

Status: Needs review » Postponed

Marking all v2 issues as postponed while v1 is finished off.

damienmckenna’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Unfortunately this module is no longer supported, so I'm closing this issue.