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
- Simple Java HTTPS server
- Getting “Handshake failed…unexpected packet format” when using WebClient.UploadFile() with “https” when the server has a valid SSL certificate
- curl: (60) Peer’s Certificate issuer is not recognized.
- Redirecting from HTTP to HTTPS with PHP
- Issues with installing python libraries on Windows : CondaHTTPError: HTTP 000 CONNECTION FAILED for url
- 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?
- Disable SSL / HTTPS for wordpress
- What do I need to do to convert my MultiSite from HTTP to HTTPS?
- WordPress in HTTPS, causing Redirect Loops
- Loading style.css and Jquery using HTTPS
- After updating site to use SSL all images in posts point to http://
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- is_singular() not working if called via callback function of admin-ajax.php
- force http canonical tag on https pages
- WordPress behind Proxy – Mixed Content
- Proper way to load a single post via Ajax?
- Displaying Meta Box Image
- custom single.php not working
- Menu links only using http after enabling https, unable to redirect http links
- In WP versions >= 4.0, is FORCE_SSL_LOGIN forcing HTTPS for the entire admin session?
- Gravity Forms not loading under https, jQuery is not defined
- WordPress SSL (https) is not working with custom permalink
- https redirect hell (adding www)
- WP Query Category Atribute Not Working
- Are theme .php files stored in the database?
- changing permalink for custom template in posts of a certain category
- Display all posts that were published before full post on single.php
- No ‘Access-Control-Allow-Origin’ header is present [closed]
- WordPress site shows “File not found.” if opened through https
- Redirect URL on OAuth2.0 after switching from http to https
- Avoid the removal of “https:” from URLs
- Web site Header tag links some resources with HTTPS
- Locked out of admin and some pictures don’t show after failed SSL installation
- Add Read More Tag to a post content (Single.php)
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- Single page site + pushState?
- Troubleshooting Plugins.php HTTP install path vs. a HTTPS for a single Plug-In
- Cant get paginations on single.php to work with my custom post types
- Thumbnail Image to go in the post aswell
- How to backup single post in wordpress [closed]
- Conditional: IF current user has NOT commented on current post (not including post author)
- List of users that clicked a ‘Join’ button at single post
- Generate HTTPS Urls in multisite
- navigation link based on custom field
- Inserting custom fields into single.php
- What does the Global Variable $s represent?
- Internet Explorer “Security Information” on every page in https site
- How to show custom field on specific custom post type posts only when filled
- Need workaround for insecure XMLHttpRequest endpoint request
- Load more posts (Ajax) in tabbed sidebar on single.php
- My single.php page skips the first div tag
- Issues after switching over to HTTPS
- content block https from http
- display multiple posts and posts content on a single URL
- Random HTTPs redirections at admin area in shared hosting
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Core update of 4.2.3 changes all link to https [duplicate]
- Access wordpress pages using a self signed shared ssl
- Parent for a single (single.php)
- How do I get a single page navigation depending on the previous page?
- The plain HTTP request was sent to HTTPS port in wordpress [closed]
- ‘Too many redirects’ error after changing site URL in WordPress [closed]
- Wrap div-tag around posts in page