http, https and relative links to resources (1 post)

  1. jcovington
    Posted 4 years ago #

    I am not challenging the fact that WordPress stores absolute URIs in the DB. What I am interested in is a way of circumventing this on a page of the site that requires https (the log in page). I figure I should be able to link to CSS and JS, using relative paths: /wp-content/themes/my-awesome-theme/js/my-elegant-script.js

    I realize that enqueuing scripts and styles is the accepted way of getting such resources on the page, but in this case they would generate URIs under http.

    Unfortunately, on https://my-domain I'm getting a bunch of 404 errors for CSS and JS included in the page using relative paths, wheres they show up just fine under http://my-domain

    I realize this may not be a WordPress-specific problem, but that probably enough people have encountered it and solved it in WordPress so as to make this a worthwhile question.

    Thanks and regards.

Topic Closed

This topic has been closed to new replies.

About this Topic