ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Fixing links to default template.

January 12, 2012 3:02pm

Subscribe [4]
  • #1 / Jan 12, 2012 3:02pm

    solent

    7 posts

    I have a template group “main”. It is set as the default template group.

    So, when I visit domain.com I get main/index.

    My internal links to the site root are <a href=”{path=main}”> which should return
    domain.com/
    but it actually returns
    domain.com/main

    So, the same content is showing up under two different URIs, I’m paying a google duplicate content penalty, and people sharing links will be sharing ‘wrong’ links.

    How can I sort this out? I’m assuming a rel=canonical will eventually fix google, but what about correcting the internal links? Should I hardcode links to the root?

  • #2 / Jan 12, 2012 3:15pm

    iPixel

    64 posts

    htaccess or iis/apache hard redirect?

  • #3 / Jan 12, 2012 7:08pm

    zizther

    228 posts

    Using {path="main"} would return domain.com/main, as it is calling it. Just becuase it is the default template group does not mean the name of the group will be ignored.

    You want to use {path=""}

    More at: http://ellislab.com/expressionengine/user-guide/templates/globals/path.html

  • #4 / Jan 13, 2012 6:48pm

    Sean C. Smith

    3818 posts

    Hi Solent,

    does zizther’s answer help you out? You could also use <a href=”{site_url}”> or do what I typically do which is <a href=”/”>

    Sean

  • #5 / Jan 14, 2012 11:06am

    solent

    7 posts

    Yes, thank. Between zzither and iPixel’s responses I can do what I need.

  • #6 / Jan 15, 2012 6:46am

    Sean C. Smith

    3818 posts

    solent.

    That’s great. I’m going to close out this thread, but feel free to post again when you have more questions.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases