@monkeypress – Your screen capture shows a missing slash in the paths which would cause these problems. A commonly occurring issue causing this to happen is an improperly defined
WP_CONTENT_URLin the wp-config.php file.
Have you looked in there? If the
WP_CONTENT_URLis defined, is it as an absolute path?
I tried setting the WP_CONTENT_URL as seen below, but it’s removing the forward slash between the domain and wp-content folder.
define( 'WP_CONTENT_URL', 'http://jaminthevalley.com/wp-content');
@monkeypress – Try …
define( 'WP_CONTENT_URL', 'http://jaminthevalley.com/wp-content/');
… or simply do not define the constant at all.
Is there a specific reason you need to define
WP_CONTENT_URLfor your site? This particular installation approach has been more prevalent in recent issues related to path/URL problems and I’m curious why its cropping up as much as it has been.
I previously didn’t have that set on our site. I thought you wanted me to for testing purposes.
@monkeypress – The problem of the missing slash is the issue, typically this is due to a poorly defined
WP_CONTENT_URL… does not defining it make any difference?
We didn’t have it defined before and were getting this issue. And then when I defined it no matter what I did I still had the same issue.
Without define(‘WP_CONTENT_URL’, ‘/wp-content’):
With define(‘WP_CONTENT_URL’, ‘/wp-content’):
Since these throw
@john LeBlanc – The
WP_CONTENT_URLshould be defined as the full (absolute) URL (http://codex.wordpress.org/Determining_Plugin_and_Content_Directories#Constants) … defining it as a relative URL will break NextGEN Gallery (at least at this time).
@photocrati Thanks for the follow-up!
Consider using content_url() instead of relying on WP_CONTENT_URL to be set properly.
You’ll see in source how it eliminates slash-related issues:
RackSpace Cloud SItes adds the relative URL in their default wp-config.php (that’s how I discovered this issue and conversation here), likely because they bundle the “Root Relative URLs” plugin with their default WP install. Root Relative had an issue, which is likely why the RackSpace failed to use the full URL: https://wordpress.org/support/topic/root-relative-uris
RackSpace Cloud Sites compatibility isn’t the motivation for my post here, however. I think content_url() is a safer way for you to build your paths to scripts (it’s filterable).
@john LeBlanc – Thanks for the follow-up. I simply could not, and still do not, understand why anyone would purposely write that definition incorrectly. I find it really surprising that it would be “RackSpace Cloud Sites” … although I have seen similar reports from other hosting services as well.
Still, this is very good information … thanks for sharing!
I just dug into this one more since it’s happening on another site. If I check out the /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php file I can see that the join_paths call is what seems to be breaking the URL. I’m not sure why, but it’s removing the starting forward slash on the get_base_url call, which is breaking all of the baths.
I can tack a forward slash on here if one doesn’t exist and suddenly everything works again.
@monkeypress – Thanks for the follow-up and the investigation. This is not a widespread specific issue as it does not occur everywhere so something must be creating this problem either in your server environment, site settings, or another piece of code affecting paths.
If you have modified the plugin’s core code it will be over-written with the next update. You might also consider testing our latest public beta found here: http://nextgen-gallery.com/nextgen-gallery-latest-beta/
- The topic ‘Undefined URLs’ is closed to new replies.