I have a problem with entity URLs in D8. All of them are absolute instead of relative, which causes various problems. For example,link URLs to edit content on /admin/content look like this:


instead of


  • It's not theme-related issue
  • I checked various custom classes implementing OutboundRouteProcessorInterface and it seems, that none of them should affect this

What could be the cause, then?

EDIT: It's the same with all Drupal-generated links.

BTW. The issue can be seen by executing

use Drupal\Core\Link;
$link = Link::createFromRoute('This is a link', 'entity.node.canonical', ['node' => 1])->toString();

It should result in relative URL, in my case it's absolute one.

  • maybe htaccess? or something with render cache.
    – user21641
    Commented Feb 13, 2018 at 13:01
  • @IvanJaros Thanks, but it doesn't seem to be caused by server misconfiguration, because it's happening in different environments. Regarding render cache, do you have some related resource to share? Thanks Commented Feb 13, 2018 at 13:04
  • check the custom code base for use of setAbsolute() method on the Url object and of course, try one of the default themes.
    – user21641
    Commented Feb 13, 2018 at 13:46
  • @IvanJaros Thanks, that method is used only in a completely unrelated way. Also, it's not a theme issue, as I described in the issue. Commented Feb 13, 2018 at 13:58
  • check settings.php for some weird logic or proxy settings. also try disabling js
    – user21641
    Commented Feb 13, 2018 at 15:17

1 Answer 1


Sorry, it was caused by

$host = $_SERVER['HTTP_HOST'];
$config['language.negotiation']['url']['domains']['cs'] = $host;

in my settings.php file. Thanks all!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.