Move wp-content outside root

by theva   Last Updated October 24, 2017 20:08 PM

I have moved my wp-content folder up one folder level from where my wp installation is:

define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/../wp-content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content' );

By doing this, the wp-content folder is now above the root folder which the server has configured. This seems to break all links to the js and css files in the theme...

The purpose of this is to make it easier to control the theme with git and control the wp version with composer. I do not intent to move the wp-content folder outside of the root folder for the web server (I guess that this is what is causing the problems with the js and css files) but I do not want the wp installation in a sub folder so that the url to my site is at either.

So, how do I solve it so that my wp installation is avaliable at while wp-content is moved outside of the wp installation folder?

Tags : wp-config

Related Questions

how to use is_admin in wp-config.php

Updated May 30, 2015 12:03 PM

wp-config.php being deleted - by plugin?

Updated July 20, 2015 14:03 PM

Can you define readability settings in wp-config.php?

Updated October 09, 2017 08:08 AM

Define new constants in wp-config

Updated January 04, 2018 22:08 PM