Renaming wp_content problem

Just FYI:

After struggling for hours, I found the aswer. The line that was causing the problem is the following in my wp-config.php file:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . "https://wordpress.stackexchange.com/");

It turned out my WP_SITEURL is not working correctly because I changed the directory structure as described in the question. So I modified wp-config.php and it now looks like this:

define('WP_CONTENT_FOLDERNAME', 'green');
define('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME);

define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/project01/');
define('WP_SITEURL', WP_HOME .  'red/');
define('WP_CONTENT_URL', WP_SITEURL . WP_CONTENT_FOLDERNAME);

Now, it works like a charm.