To globally redirect all your pages to HTTPS add the following lines to your .htaccess
:
# Globally force SSL.
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This should be placed directly after RewriteEngine on
if you have no previous rewrites.
Related Posts:
- Admin-Ajax.php, SSL, Non-SSL
- How disable SSL redirect for specific URL?
- How to modify the .htaccess to force ssl on login and admin pages
- Transfer to HTTPS – mixed content on main page only [closed]
- Https Redirect infinite loop in Mobile browsers
- 403 error on admin login page
- Adding a SSL Certificate
- HTTP sitewide, except for: wp-admin, and 2 custom directories
- Stop WordPress and Plugins from Overwriting .htaccess
- htaccess rewrite conflict with wordpress rules and ssl
- htaccess https redirect from www to non-www
- Force HTTPS using .htaccess – stuck in redirect loop
- How to redirect url requests to https? [closed]
- Setup Permanent 301 Redirects after moving to Https [closed]
- https multiple redirects
- How to properly force https and www on multisite with Apache HTAccess
- Redirect http to https does not work on subdir where another instance of WordPress installed
- I can’t access the admin panel links as I click it shows 403 error
- What is the right way to redirect all traffic to HTTPS?
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- How can I fix the redirect chain after implementing ssl on wordpress?
- Forcing HTTPS with WordPress on AWS
- Locked out of admin and some pictures don’t show after failed SSL installation
- Conflict with Force SSL and Rewrite Rules
- ReDirect subfolder link to another sub-folder and force SSL
- Force non-ssl on WordPress RSS feeds in htaccess, using cloudflare
- fix 302 redirection error on https
- Redirect https://www.subdomain.domain.com is not redirecting to subdomain.website.com [closed]
- HTTPS to HTTP rewrite rules not working as expected
- Steps for WordPress over SSL
- The connection to “domain” is not secure
- Mixed Content Page: requested an insecure stylesheet error
- SSL breaks customizer: page isn’t returned from ajax
- Local version of a WordPress site – SSL/HTTPS enforced?
- Static raw HTML page
- .htaccess file redirecting to parent directory
- WordPress redirect loop on nginx + apache reverse proxy
- Redirect from https to http or from http to https? [closed]
- Correct htaccess to display page while also passing in GET parameters
- How have I misconfigured basic auth for my wordpress site?
- WordPress trims off the forward slash when import
- WordPress best solution shared theme for consumers and businesses (two url’s one instaltion)
- Redirect main domain to subdirectory
- Removing code added to htaccess with insert_with_markers
- How to set up htaccess to redirect a particular post type or subdirectory to HTTPS?
- Enable Full SSL for WordPress
- WordPress 404 on Subdomain
- Can’t Access Subdirectory
- WordPress Dashboards: slowness and timeouts
- I changed my site from HTTPS back to HTTP and now it is broken- Cannot access Admin panel on HTTP URL
- HTTP Error 406 always on site?
- Point all URLs to homepage but maintain URL
- htaccess working on local server but not on live server
- External content won’t load in iframe in Safari
- How to write .htaccess so that https is on for subpages only but not the home page
- Custom rewrite rule, url returning 404
- Too many redirects after added SSL redirect on port 80 virtual host
- Website access with http and https
- mod_rewrite doesn’t work as I want even with JSON API Plugin disabled
- Htaccess https 301 problem
- How to control SSL in WordPress for automatically changing http to https?
- WordPress .htaccess file gives issues with subdirectory
- W3 Total Cache CSS & JS files GZip issues [closed]
- WP Super Cache unable to locate cache file for only the homepage
- Cannot login to WordPress site after changing .htaccess for security purposes
- WordPress permalink, stop redirection
- add_rewrite_rule to remove /category/ from permalink
- disable WordPress 404 for one specific page/folder to receive actual php errors
- .htaccess Non-‘www’ to ‘www’ Subdomain Redirection Only Works for Homepage
- Non WordPress Folder in a WordPress Site
- Htaccess rewrite based on query string, not working [closed]
- Redirect all subdomains to root domain
- Change root directory
- How to execute WordPress as though it is in the root folder while it is installed in a subdirectory?
- Htaccess maintenance page rules that actually work with WordPress?
- How to allow only vpn access to dashboard on Bitnami WordPress by IP address restricting
- Why does WordPress uses HTTPS for JS, CSS on EC2
- Blocking wp-login in HTACCESS has also blocked password protected pages
- htaccess redirect to path
- Non-wordpress subdomain on Multisite Installation
- Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN
- Unable to find ‘full-path’ to my 404.php file
- Rewrite rules and maintain URL
- Subfolder renaming
- My site thinks it’s secure when it is fact not
- Targeting .htaccess file with file_put_contents
- Redirect Loop in Regex Moving to HTTPS
- .htaccess file changes disappear
- WordPress login bug. Need an emergency solution
- How do I secure a subdomain using UCC SSL?
- My WordPress site SSL is in red crossed color and can’t load at first time?
- .htaccess and virtual host configuration for WP in its own directory
- 403 forbidden due to .htaccess?
- Serve HTTPS requests from subdomain
- Where is the htaccess in wordpress.com hosting?
- Debug errors for “Destination directory for file streaming does not exist or is not writable”
- Remove “www” and redirect to “https” with nginx
- How To Add CSP frame ancestors in WordPress Website? [closed]
- How do I modify each instance of setcookie?
- Https Website: CSS and JS files load in http and admin page does not load too