Relative URLs in WordPress

前端 未结 8 1276
执念已碎
执念已碎 2020-12-04 07:29

I\'ve always found it frustrating in WordPress that images, files, links, etc. are inserted into WordPress with an absolute URL instead of relative URL. A relative url is mu

8条回答
  •  日久生厌
    2020-12-04 08:08

    Under Settings => Media, there's an option for 'Full URL-path for files'. If you set this to the default media directory path '/wp-content/uploads' instead of blank, it will insert relative paths e.g. '/wp-content/uploads/2020/06/document.pdf'.

    I'm not sure if it makes all links relative, e.g. to posts, but at least it handles media, which probably is what most people are worried about.

提交回复
热议问题