I just used this in the functions file in the end
function force_ssl()
{
// Specify ID of page to be viewed on SSL connection
if (is_page(8616) && !is_ssl () )
{
header('HTTP/1.1 301 Moved Permanently');
header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
exit();
}
// All other pages must not be https
else if (!is_page(8616) && is_ssl() )
{
header('Location: http://' . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
exit();
}
}
add_action('template_redirect', 'force_ssl');
Related Posts:
- Is it possible to use a single custom post as the site front page
- Listing a post’s categories and subcategories
- Single post comment template not working
- How do I show google ads between post content?
- Add inline style to get_the_category_list
- Help with figuring out the future post workaround
- Disable single view for specific post category
- Only nextpagelink on wp_link_pages
- Display a post map on a blank/new page
- How To Pass Current Post Type ID from Single Template To Custom Page Template
- Is it possible to create rel=”noindex, nofollow” for a single post if contain bad keywords?
- Custom seperate Single.php
- Set a cookie only in single posts
- Custom post type not respecting template hierarchy
- diffrent style for post single page
- WordPress object for comments frame [closed]
- I’m having a problem viewing the Youtube video
- Use different «Single.php» for custom categories
- Single custom post type template not working (single-custom_post_template.php) not working
- Single.php category entries not showing right colours
- Link from archive-page.php to single-page.php
- How to check if a post is in categories x,y,z inludint their subcategories
- Changing the display of the themename_posted_on() function
- How to Highlight current category on category and single page template?
- Exclude single page from function
- WordPress, alternative single post template
- get full real path of thumbnail post img wordpress
- how to loop through this in blog single?
- Modify post template on Divi Theme
- I want to signin from first wordpress site to other wordpress website without registration..without using network mode
- Try to showing product file size on product single page
- Improve related posts
- Get active term on single (CPT) page
- Having single posts appear under the blog homepage and highlight menu items properly?
- Single.php loading fully on localhost but not on server
- explain why is_single doesn’t work
- SSL Error: unable to get local issuer certificate
- How to redirect all HTTP requests to HTTPS
- How can I make git accept a self signed certificate?
- https connection using CURL from command line
- HTTPS connections over proxy servers
- @ converted to %40 in HTTPPost request
- Curl command for https ( SSL )
- nodejs – error self signed certificate in certificate chain
- Custom Tumblr theme wont save because of non-https urls?
- Simple Java HTTPS server
- Unrecognized SSL message, plaintext connection? Exception
- HTTPS connection Python
- Make a HTTPS request through PHP and get response
- How to execute a https GET request from java
- Java: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Enabling HTTPS on express.js
- Mixed Content Page: requested an insecure stylesheet error
- How do you redirect HTTPS to HTTP?
- Ngrok errors ‘502 bad gateway’
- Could not establish secure channel for SSL/TLS with authority ‘*’
- Getting “Handshake failed…unexpected packet format” when using WebClient.UploadFile() with “https” when the server has a valid SSL certificate
- ndroid 8: Cleartext HTTP traffic not permitted
- Python requests SSL error – certificate verify failed
- Why am I suddenly getting a “Blocked loading mixed active content” issue in Firefox?
- How to fix “insecure content was loaded over HTTPS, but requested an insecure resource”
- How to find out if you’re using HTTPS without $_SERVER[‘HTTPS’]
- Https to http redirect using htaccess
- How can I force users to access my page over HTTPS instead of HTTP?
- curl: (60) Peer’s Certificate issuer is not recognized.
- How to force Laravel Project to use HTTPS for all routes?
- How can I fix the “No certificates found – The app Chrome has requested a certificate” Android / Google Chrome issue
- Redirecting from HTTP to HTTPS with PHP
- Issues with installing python libraries on Windows : CondaHTTPError: HTTP 000 CONNECTION FAILED for url
- file_get_contents() how to fix error “Failed to open stream”, “No such file”
- How to disable the single view for a custom post type?
- How do I disable responsive images in WP 4.4?
- How to check if the product is in a certain category on a single-product.php in Woocommerce?
- Custom post type single page returns 404 error
- SSL Breaks WordPress CSS
- Custom post type single-{custom}.php not working
- Setting $_SERVER[‘HTTPS’]=’on’ prevents access to wp-admin
- What is singular.php?
- How to detect single.php (but not single-portfolio.php)?
- Disable SSL / HTTPS for wordpress
- Conditional for single-{post-type}.php
- Switching MultiSite installation from HTTP to HTTPS
- Check IF is a “single product page” and Check the “role” for a Redirect
- Why is WordPress redirecting from http to https on a local environment?
- How to modify single.php in a child theme?
- How to migrate a HTTPS WordPress installation to localhost?
- Switch from https back to http
- Add_action to wp_head via functions.php
- Stop WordPress from using HTTPS and just use HTTP
- What do I need to do to convert my MultiSite from HTTP to HTTPS?
- Chrome Version 44.0.2403.89 m is trying to force HTTPS
- Is there a way to force ssl on certain pages
- Custom Single Post By Category
- HTTPS leads to Sorry, you are not allowed to access this page
- SSL breaks customizer: page isn’t returned from ajax
- How to prevent WordPress from loading the jQuery library at the top of the page
- Stop WordPress and Plugins from Overwriting .htaccess
- Using single.php from plugin folder instead of default template folder
- Template for specific post of custom post type
- How do I get the category URL from get_the_category?