Opened 8 years ago
Closed 7 years ago
#34609 closed feature request (duplicate)
Image URLs should be hostnameless and methodless by default
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
The plugin https://wordpress.org/plugins/relative-image-urls/ implements behavior that I think ought to be WordPress's default behavior.
Consider:
- Fewer HTTP requests, so faster page load time.
- No problems with partially secure pages (some resources HTTP on an HTTPS page or vice versa).
- Sites can be moved to a new domain without having to edit every single post and page to fix the URLs of the images.
Note that I'm not asking for image embedding to use relative URL paths, which has been refused previously for valid reasons.
Rather, I'm asking for images to be embedded with absolute paths but no hostname or method, so that the browser uses the hostname and method of the current page.
Change History (6)
#2
@
8 years ago
Note that I'm not asking for image embedding to use relative URL paths, which has been refused previously for valid reasons.
Rather, I'm asking for images to be embedded with absolute paths but no hostname or method, so that the browser uses the hostname and method of the current page.
How is that different from a relative URL?
#3
@
8 years ago
I was thinking of relative URLs like page /foo/bar referring to ../../wp-content/04/2015/08/image.jpg -- which is obviously not a good idea.
I just had to change the URL of an MU install, and it was a major pain. Having the absolute URL encoded in every piece of rich text can't be the best answer.
What if images were inserted using a shortcode rather than raw HTML, and the shortcode generated the absolute URL at runtime? That way you'd still end up with absolute URLs in RSS feeds and e-mails, but it would be easy to change the base URL of the site without having to do a search and replace on every piece of content.
(You could also make the shortcode generate retina-ready srcsets into the bargain.)
Please see:
https://make.wordpress.org/core/handbook/contribute/design-decisions/#absolute-versus-relative-urls
Also #17048