Question: So I've been looking at this for way too long. Really hope someone could help me out :) I'm just trying to create a module that creates a directive and controller for my site header in AngularJS. I don't get any error and the log in my code won't show up. This is the code related to the header module:

**header/header.js**

```
 'use strict';
angular.module('myApp.header', [])

.directive("headerBar", [function(){
  return {
    restric: "E",
    templateUrl: "header/header.html",
    controller: 'HeaderCtrl'
  };
}])

.controller('HeaderCtrl', ['$log', function($log) {
  $log.log('test header controller');
}]);

```

**app.js**

```
angular.module('myApp', [
  'ngRoute',
  'myApp.header'
]).
config(['$routeProvider', function($routeProvider) {
  $routeProvider.otherwise({redirectTo: '/'});
}]);

```

**index.html**

```
<script src="header/header.js"></script>

<header-bar></header-bar>

```

Answer: 
This are the steps, what I have done to make it success !,

**1.** Change the root folder name from **\htdocs\OldSiteName** to **\htdocs\NewSiteName** .

**2.** Change the **wp-config.php** 

From,

```
    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/OldSiteName');
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/OldSiteName');

```

To,

```
   define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/NewSiteName');
   define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/NewSiteName');

```

**3.** Change the content in the **.htaccess** file

From,

```
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /OldSiteName/
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /OldSiteName/index.php [L]
</IfModule>

```

To,

```
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /NewSiteName/
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /NewSiteName/index.php [L]
</IfModule>

```

**4.** Execute the scripts to change the values in the database.

```
UPDATE wp_options 
SET option_value = 'http://127.0.0.1/NewSiteName' 
WHERE option_name = 'home';

UPDATE wp_options
SET option_value = 'http://127.0.0.1/NewSiteName'
WHERE option_name = 'siteurl';

UPDATE wp_posts
SET post_content = REPLACE(post_content,'http://127.0.0.1/OldSiteName','http://127.0.0.1/NewSiteName');

UPDATE wp_posts
SET guid = REPLACE(guid,'http://127.0.0.1/OldSiteName','http://127.0.0.1/NewSiteName');

```

These are all the steps that I have done to make all the pages and inter links to get worked. **eg:** Clicking menu should take it the correct page.

**Note :** Reference link : <https://wordpress.org/support/article/changing-the-site-url/>
Search replace db is a good tool to replace all old url with new urls. You can download latest file from

[seach replace db](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/)

Perform following steps

1. put the file on wp directory
2. open wp config file and change database credentials
3. open url in browser (<http://localhost/wordpress/downloadedfile.php>)
4. read instruction and go to next step till it complete.

This tool help you to upload or migrate database from localhost to server or server to server.