Hyphens or underscores when referencing a path alias in Drupal 7 templates? I have a hyphenated path alias in my site and I need to reference it in a template hook, but it seems hyphens get converted to underscores in templates, so I'm wondering how I would go about outputting the code correctly. 

My function is something along the lines of if my path alias is "change-directory" then use the "page__change-directory" template. So my question is, would it be "change-directory" or "change_directory" in my template?
When a hyphen is used in a template filename, or template suggestion, the hyphen is replaced with an underscore. That is done in theme_get_suggestions(), and drupal_find_theme_templates() which use, respectively, the following code.

// Remove slashes or null per SA-CORE-2009-003 and change - (hyphen) to _
// (underscore).
//
// When we discover templates in @see drupal_find_theme_templates,
// hyphens (-) are converted to underscores (_) before the theme hook
// is registered. We do this because the hyphens used for delimiters
// in hook suggestions cannot be used in the function names of the
// associated preprocess functions. Any page templates designed to be used
// on paths that contain a hyphen are also registered with these hyphens
// converted to underscores so here we must convert any hyphens in path
// arguments to underscores here before fetching theme hook suggestions
// to ensure the templates are appropriately recognized.
$arg = str_replace(array("/", "\\", "\0", '-'), array('', '', '', '_'), $arg);




// Transform - in filenames to _ to match function naming scheme
// for the purposes of searching.
$hook = strtr($template, '-', '_');
if (isset($cache[$hook])) {
  $implementations[$hook] = array(
    'template' =&gt; $template, 
    'path' =&gt; dirname($file-&gt;uri),
  );
}


Whenever you are adding a theme template suggestion, or you are looking for a template file to use, you should replace hyphens with underscores, in the same way Drupal does.