Incorrect stylesheet/script paths with WordPress in its own directory
-
With wordpress installed to /wordpress/ it looks like the URLs being generated to stylesheets and scripts are wrong:
L630 in class-bwp-minify.php seems to be responsible for removing one of the slashes in https:// although it does nothing to indicate why its an absolute path instead of relative like before:
$src = preg_replace(‘#[\/]{2,}#iu’, ‘/’, $src);
After installing FirePHP on Chrome and navigating directly to the URL the output in my console was:
Minify GET param ‘f’ was invalid /home/ckane/www/wp-content/plugins/bwp-minify/min/lib/FirePHP.php:387
With wordpress in the root web accessible directory the URL is:
https://example.com/wp-content/plugins/bwp-minify/min/?f=wp-content/themes/html5-reset-wp/style.css
To move WordPress to its own directory and wp-config.php one up from the web accessible directory I have added these to my wp-config.php:
// Define Site URL: WordPress in a subdirectory.
if ( ! defined( ‘WP_SITEURL’ ) )
define( ‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’] . ‘/wordpress/’ );// Define Home URL
if ( ! defined( ‘WP_HOME’ ) )
define( ‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’] );// Define path & url for Content
define( ‘WP_CONTENT_DIR’, dirname(__FILE__) . ‘/www/wp-content’ );
define( ‘WP_CONTENT_URL’, WP_HOME . ‘/wp-content’ );// Set path to MU Plugins.
define( ‘WPMU_PLUGIN_DIR’, dirname(__FILE__) . ‘/www/wp-content/mu-plugins’ );
define( ‘WPMU_PLUGIN_URL’, WP_HOME . ‘/wp-content/mu-plugins’ );/** Absolute path to the WordPress directory. */
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/www/wordpress/’);
- The topic ‘Incorrect stylesheet/script paths with WordPress in its own directory’ is closed to new replies.