Hey there,

first of all: great work guys, the metatag module is really a must-have and now even available for D8 :)

We use it on a Drupal 8 blog which lives in a subdirectory, e.g. www.site.com/blog/ and the extracted image URLs are wrong in that case.

Currently: www.site.com/blog/blog/sites/default/files/2016-03/team.jpg
Correct would be: www.site.com/blog/sites/default/files/2016-03/team.jpg

The problem seems to be the use of $base_url because both the base url AND the image path contain the subdirectory (/blog).
I suggest to use $base_root in this case since the relative image path starts with a "/" and thus references www.site.com/ and not www.site.com/blog/.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kplanz created an issue. See original summary.

kplanz’s picture

Status: Active » Needs review
FileSize
740 bytes

  • DamienMcKenna committed 5f1c1ba on 8.x-1.x authored by kplanz
    Issue #2689543 by kplanz: Fixed paths in image meta tags when the site...
DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #2684497: Plan for Metatag 8.x-1.0-beta6 release

Committed. Thanks!

Status: Fixed » Closed (fixed)

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