Not sure if this pathologic-related but I've been using the 7.x-2.x-dev for awhile now - though recently I noticed some of my links had turned into IP addresses to my own domain (the links in question were blocks with images in them). I immediately noticed because I was using the extlink module which alerted me I was going to another site when clicking the home button. The link was correct when I checked the block (as it always has been) and I don't have an IP address as a basepath (if that's even possible?).

Saving the block fixed some links, and clearing the cache fixed the rest. But not sure about the reason for this issue? I am also using some multilingual modules as the site is in two languages. Is it something to do with caching/people visiting the IP address version of the site?

Thanks.

Comments

Roden’s picture

Issue summary: View changes
Garrett Albright’s picture

Status: Active » Fixed

Is it something to do with caching/people visiting the IP address version of the site?

Yes, most likely, though it could be bots instead of people. Pathologic calls the url() function, which in turn uses the global $base_url variable. If you didn't set this variable manually in your site's settings.php file, then Drupal makes its best guess for it in the bootstrap process. If the site is accessed via an IP address rather than a domain name, $base_url will have that IP address.

There are two solutions to this. One, the better solution, is to configure your web server so that requests which are not made with a domain name are redirected to one. The other is to set $base_url manually in your settings.php file, though I'm not sure how well that would work on a multi-lingual install, and it doesn't solve the root problem of your site being accessible without a domain name (which may or may not cause problems outside of just Pathologic).

Please give these a try. I'm gonna close the issue since I'm sure that they should solve your problem, but feel free to re-open with more explanation if you're still having issues.

(Note to self: I should add a section in the documentation about this sort of thing since it's a semi-recurring issue that even I get tripped up on sometimes.)

Garrett Albright’s picture

Oh, I forgot a third possible solution: Use "Path relative to server root" for Pathologic's "Processed URL format" setting. Like with the $base_url approach, it doesn't solve the broader problem and may not work for how your site is used, but if it does work for you, it's the simplest solution of the three since it just requires clicking in the Drupal admin UI.

Roden’s picture

Thanks Garrett, much appreciated! I'll definitely give these a shot - the third one sounds the best if it works!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.