#21153 closed enhancement (wontfix)
supporting protocol-relative urls
Reported by: | nagyv | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3.2 |
Component: | General | Keywords: | close |
Focuses: | Cc: |
Description (last modified by )
changing http://
and https://
generated links to //
links would easily add support for hosting a site both under http and https easily
one place I've found this to be changed is in wp-includes/link-template.php around line 2006
the first if could be changed to:
$url = str_replace( "https://", "//", $url) $url = str_replace( "http://", "//", $url)
Attachments (1)
Change History (14)
#1
@
12 years ago
I don't think you're tracing the code far back enough ... WP_CONTENT_URL is defined partially off of get_option( 'siteurl' ); -- which currently requires there to be a http:// or https://
Your best option with this may be to enable defining that as example.com rather than http://example.com or https://example.com
#2
@
11 years ago
@georgestephanis, there is no ticket for home and siteurl protocol relative options, correct? If not, I think that's the core issue and this ticket should be retargeted to solving it.
3.9 still doesn't let me set addresses as //domain.com
#5
@
10 years ago
- Milestone changed from Awaiting Review to 4.1
The issue is that sanitize_option() specifically requires http(s?)://
.
#6
@
10 years ago
Looks like changing the regex in sanitize_option()
is not enough:
- If you set
home
andsiteurl
to a relative URL, you can no longer log in. - Links are still generated with
http://
.
#10
@
9 years ago
- Keywords close added; needs-patch removed
A WordPress site should either be configured to serve HTTP or HTTPS, the protocol relative URL is an anti-pattern.
We should review our HTTPS setup documentation and see if it can be improved.
a git diff