Change the site name programmatically for a specific page I am trying to change the site name when a user enters specific pages on my website. 
I know the variable for the site name is $site_name and is being retrieved from the system.tpl.html file. 

So I am trying to set different site names depending the URL; for example, when a user visits /about_us, the site name should change. 

In my template.php file, I have captured the path in a variable.

$path = drupal_get_path_alias();
if ($path == 'about_us') {
  $site_name = 'New title';
}


This won't work. 

How can this be achieved?
I think you mean page.tpl.php (not system.tpl.html, which isn't a standard Drupal file).

That said, you need to put your code in a hook_preprocess_page() function inside template.php, and actually alter the template variables that are passed in. At the moment you're just creating a variable called $site_name in the local scope, and Drupal has no way to pick that up.

Try this:

function MYTHEME_preprocess_page(&amp;$vars) {
  $path = drupal_get_path_alias();
  if ($path == 'about_us') {
    $vars['site_name'] = 'New title';
  }
}


Have a look at Setting up variables for use in a template for a bit more info.