Hello,

I tried setting up a custom rule for
taxonomy/*
pages as Google indexed my tags via taxonomy/term urls

Yet, I have aliased these to be like
tags/*

Now when I setup for
taxonomy/*
pages to be noindexed, they were applied for tags as well.

Would love such a feature in nodewords.

Comments

avpaderno’s picture

The development snapshot already checks the path aliases, and compares the aliases with the other pages paths.

  foreach (_nodewords_get_pages_data() as $page) {
    $path = $page->path;

    if (drupal_match_path($_GET['q'], $path)) {
      return array(NODEWORDS_TYPE_PAGE, $path);
    }

    $bool = (
      ($alias = drupal_get_path_alias($_GET['q'])) != $_GET['q'] &&
      drupal_match_path($alias, $path)
    );

    if ($bool) {
      return array(NODEWORDS_TYPE_PAGE, $page->pid);
    }
  }

If you set meta tags for a path like tags/* and the alias of the page is tags/test (in example), then those meta tags are used.

avpaderno’s picture

When you use the alias of a page to reach that page, Drupal passes in $_GET['q'] the effective path for the page, not the alias. As consequence, if you set meta tags for a path and for that path alias, the later meta tags will not be applied.
When defining meta tags for a path alias, you need to assign to it a lower weight than the rule for the normal path, so that the rule for the alias is interpreted first.

giorgio79’s picture

Status: Active » Fixed

Thanks Kiam, sounds great. will be checking it soon

avpaderno’s picture

A note on why the path aliases are checked for last; the code checks the path aliases for last to avoid a not necessary database query.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.