• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

URL Generation in Genesis and WP

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › URL Generation in Genesis and WP

This topic is: not resolved
  • This topic has 3 replies, 4 voices, and was last updated 12 years, 4 months ago by Summer.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 30, 2012 at 5:32 am #8326
    AntiSocialNetwork
    Member

    Is basically broken.

    There I said it.  I have a site which is hidden behind a proxy server.  The WP machine is running a vanilla PHP install on Apache with no SSL cert.  The reason is that the blog is but one server in a cluster of many different machines with different jobs all living under a common domain (call it http://www.example.com).  There is a NGINX server in front of everything handling routing based on url paths.  The NGINX handles the SSL encryption and then communicates with backend servers using http.  Works fine.

    However - this means that the WP installation thinks it is operating under http rather than https.  Any test of headers in any code comes up with protocol http and not https.  So any absolute URLs generate such as for style sheets and JS files are being generated with a big fat http: in front and conservative browsers like Chrome are declining to load them as they are viewed as potential security threats.  The problem actually runs to the very core of WP but Genesis does its part to encourage the madness. There is a solution though.

    In order to fix our site I did the following modifications to the definition of CHILD_URL and PARENT_URL.  I did

    define( 'CHILD_URL', ltrim(get_stylesheet_directory_uri(),'htpsHTPS:') );

    which crudely strips off any leading http/https protocol.  The reason this is OK is because RFC 3986 part 4.2 allows for protocol-less or protocol relative URLs. So instead of http://www.example.com it is fine to use //www.example.com and the browser will use whatever protocol was used to fetch the parent page.

    Please update your code to use protocol-relative URLs and join me in influencing WP developers to switch to protocol-relative URL generation. In the end, all our code will be more secure.

    Thanks

    January 26, 2013 at 3:33 pm #15097
    SoZo
    Member

    +1


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    September 25, 2013 at 12:43 pm #64123
    slhuckstead
    Member

    Did you hack Genesis core and replace their define with yours in init.php or did you put that someplace in the child theme? Regardless, niether are working for me. What's the secret sauce?

    September 25, 2013 at 1:10 pm #64129
    Summer
    Member

    I noticed YouTube started using those references in their embed codes a few months ago, and damned if I didn't think it was a major typo on the part of one of my site's contributors when I first saw it.

    If it helps cut down on those http/https fooferalls, I'm for it.


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble