How do I use a custom template file? I tried using a custom template file for my theme, but using page--testpage.tpl.php (where testpage is the path alias for the page being shown) doesn't work. It just works with page--node--47.tpl.php

How could I fix it?
Read Drupal 7 Template (Theme Hook) Suggestions


  A theme hook suggestions is an alternate template (.tpl.php) file that
  you have created to override the base or original template file.


The list of suggested template files is in order of specificity based on internal paths. One suggestion is made for every element of the current path, though numeric elements are not carried to subsequent suggestions. For example, "http://www.example.com/node/1/edit" would result in the following suggestions:

page--node--edit.tpl.php

page--node--1.tpl.php

page--node.tpl.php

page.tpl.php

Read Theming Drupal 6 and 7

If you still want to alter the suggestions its possible with template_preprocess_page

function template_preprocess_page(&amp;$variables) {
  $variables['theme_hook_suggestions'][] = "page--type--" . $vars['node']-&gt;type;
  // likewise you can do 
  // $variables['theme_hook_suggestions'][] = "page".GET-URL-ALIAS-HERE;
}