Question: So, two questions!

1. When using header('location: newHome.php') Does that file need to be in the same directory?

I was going to have my signOut.php in the main directory, and be able to sign out of the website from any page.. example.com/example/example.example.html
2. My code just returns a error page at example.com/signOut.php The signOut.php is in the same directory as where I am testing it from..

**example.com/example.php**

```
<li><a href="signOut.php"><strong>Sign Out</strong>

```

**example.com/signOut.php**

```
<?php 
session_start();
$_SESSION = array();
session_destroy();
header('Location: http://www.example.com/newHome.html');
?>

```

Answer: 
*1) Answer to your 1st Question (When using header('location: newHome.php') Does that file need to be in the same directory?)*

If you will not give any path then **Yes** it must be in the same directory.

Though, you need to define constant for your website URL like below:

```
define(SITE_URL,"http://www.example.com/");

```

And then use it anywhere in your website like below:

```
<li><a href="<?php echo SITE_URL; ?>signOut.php"><strong>Sign Out</strong>

```

Follow below link to learn more about Constants :

<http://php.net/manual/en/function.constant.php>

*2) Answer to your 2nd Question (My code just returns a error page at example.com/signOut.php)*

This is happening because your path is not correct. Manually correct the path or follow my first answer and define constant to correct it.

I don't think there is any issue with Headers as error you are saying with 404 Not found.
either, in the same folder

```
header('location: newHome.php');

```

or, not in the same folder

```
header('location: path/to/newHome.php');

```

or, a full URL 

```
header('Location: http://www.example.com/newHome.html');

```