Serve HTTPS requests from subdomain

I need a single WordPress installation to be available from both the main domain (www.example.com) via HTTP and a subdomain (secure.example.com) via HTTPS.

Of course i can just map the subdomain to the WordPress folder in Nginx config. But will
Wordpress be aware that it is called via HTTPS and change all links on the pages to HTTPS ?

Read More

Also, how i can i force certain pages to be automatically redirected to their HTTPS equivalent permalink (and then back again to HTTP) ?

Related posts

2 comments

  1. will WordPress be aware that it is called via HTTPS and change all links on the pages to HTTPS ?

    While WordPress knows if a request comes via HTTPS, it doesn’t change all the links automatically. Only certain links are updated to use https:// that too, without any subdomain part. Any hardcoded links would remain the same.

    how i can i force certain pages to be automatically redirected to their HTTPS equivalent permalink (and then back again to HTTP) ?

    Short answer: Use this plugin… http://wordpress.org/plugins/wordpress-https/ that has plenty of options.

    Bit longer answer: It depends on your exact requirement. For example, if you’d like to use SSL for all WordPress backend operations, then it can be done without a plugin. If you’d like your backend to use SSL and a sub-domain, then the above plugin may help. Still, you may not achieve this with a single WordPress installation. So, sub-domain would probably require its own WordPress installation and a separate database, with regular syncing of common files / folders.

    I hope that helps!

  2. Read Administration Over SSL article on codex, it will help you to properly setup SSL for your admin and login pages. After you setup your site as it required in that article, your WP instance will properly redirect you to the HTTPS pages.

Comments are closed.