Although the answer in the comment to your question will work (here it is formatted), there are some variations that might be needed depending on your hosting environment, so contact your hosting support for specifics.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Related Posts:
- Redirect www to non-www htaccess
- Redirect from https to http or from http to https? [closed]
- How to use https on one page only?
- Understanding Redirects
- How to redirect all HTTP requests to HTTPS
- Why is WordPress redirecting from http to https on a local environment?
- Force HTTPS using .htaccess – stuck in redirect loop
- How to redirect url requests to https? [closed]
- 302 redirect instead of 301 after switch to HTTPS
- Redirect to https not working with .htaccess [closed]
- Menu links only using http after enabling https, unable to redirect http links
- Cant Access Website – Changed HTTP to HTTPs
- https multiple redirects
- some url does not redirect from http to https
- https redirect (with .htaccess) redirect loop
- What is the right way to redirect all traffic to HTTPS?
- 301 redirection editing .htaccess doesn’t work
- WordPress keeps redirecting subpages without http to https homepage after switch
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- ReDirect subfolder link to another sub-folder and force SSL
- My site doesn’t redirect from HTTP to HTTPS
- HTTPS to HTTP rewrite rules not working as expected
- WordPress site not forcing from http to https instead getting redirected too many times
- Moving site from HTTP to HTTPS
- WordPress HTTPS – ‘… better to use HTTP for installation …’
- How to force HTTP and stop SSL completey on WordPress website
- Does WordPress automatically redirect to the URL specified in settings?
- What does HTTP/1.1 302 mean exactly?
- Https to http redirect using htaccess
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- WordPress Redirect All HTTP requests to HTTPS via .htaccess
- Redirect entire website to a single page
- Stop WordPress and Plugins from Overwriting .htaccess
- Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
- Non-WordPress page in subdirectory under WordPress page
- Keeps on redirecting on my development copy
- Redirecting WordPress /.htaccess / HSTS / SSL
- 301 redirect not working through .htaccess
- Site redirects to wrong url when saving settings
- Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
- Redirecting old permalink to new one
- Index in root, wordpress in subdirectory
- Specific URL has 403 Forbidden status code
- How do I skip wordpress’s 404 handling?
- How are both HTTP and HTTPS versions displaying?
- Problem to redirect custom page using htaccess
- htaccess redirect not working
- htaccess wildcard redirect misses some URLs
- WordPress redirect loop on nginx + apache reverse proxy
- Redirect too many times htacces switching to https
- How to do 301 redirect to Sub page using htaccess file?
- htaccess redirect – directory and subpages to a single page
- WWW to non WWW redirect effects on load speed
- Can WordPress redirect to a “similar page” in case of 404 error
- htaccess redirect dynamic posts
- Hacked website redirect, only on desktop, help with restoring it [closed]
- Disabling the X-Redirect-By response header
- RedirectMatch and Redirect interfering with each other
- Mixed Content with SSL, wordpress behind a reverse proxy
- How to hide that a certain non-WordPress directory exists on the server?
- Get the final destination after WP_Http redirects (WordPress)
- Redirect “any page/page/number/” to “any page”
- Why specific file directory fails to redirect but its parent folder succeeds?
- WordPress site in subdirectory load site in main directory
- How to create a 301 redirect that doesn’t apply to subsites
- Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?
- WordPress multisite htaccess redirection to new domain
- Why can’t I access files / directories outside of wordpress
- WordPress blocking/preventing viewing of .cgi file in subdirectory [closed]
- Redirect blogpage /blog/abcd/ to /blog/
- Redirect HTTP to HTTPS
- How to redirect from various ?page_id= to home page?
- How to set up htaccess to redirect a particular post type or subdirectory to HTTPS?
- Deny access to a path (give 403 or 404 response)
- htaccess 301 redirect http to https doesn’t work
- Site redirecting from http to https [closed]
- Redirect home to another page with htaccess
- Redirect all pages except one to homepage via .htaccess
- 301 Redirect Loop
- Redirect 301 www.my-site.com/page/n to www.my-site.com/ [closed]
- Redirecting old post url to 404 in wordpress using htaccess
- WordPress Redirecting HTTPS Requests to HTTP
- Headless WordPress redirect front-page to login page [closed]
- How to redirect subcategories to a page?
- Infinite loop behind SSL proxy on non-standard port
- Use htaccess to redirect WordPress to static website in a subfolder
- htaccess redirects and WordPress
- Redirect blog archive into certain format
- 301 Redirect To Post ID
- CNAME vs A Record for WWW – with 301 Redirects
- How to publish new posts/pages in root instead of subfolder, but keep old structure in place?
- forward domain name to particular page?
- htaccess rules not applied?
- Use virtual pages point to one specific page
- set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL
- htaccess redirect – replace special character
- Redirect http to https does not work on subdir where another instance of WordPress installed
- Redirect from sub-directory to root – New WordPress 5.2.3 Set up
- How to add new redirection on wordpress site
- Load time cost of using a redirect plugin v direct .htaccess entry