Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 ?

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

share|improve this question
    
I think the Wordpress-HTTPS plugin is the way to go. Great Tip! –  Leo Houer Oct 6 '13 at 23:18

2 Answers 2

up vote 0 down vote accepted

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!

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.