Title: 301 redirect from http to https page level
Last modified: September 1, 2016

---

# 301 redirect from http to https page level

 *  [timmer81](https://wordpress.org/support/users/timmer81/)
 * (@timmer81)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/)
 * I currently have a site wide 301 redirect from http to https which works ok alongside
   a redirect from non www to www.
 * When I type in the url for any other page non https it’ll show the non secure
   page and not redirect to https version. How to I correct this within .htaccess?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7636872)
 * Supposedly this forces https:
 *     ```
       RewriteEngine On
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
       ```
   
 *  Thread Starter [timmer81](https://wordpress.org/support/users/timmer81/)
 * (@timmer81)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7636904)
 * This is my current .htaccess file
 *     ```
       RewriteOptions inherit
       <IfModule LiteSpeed>
       RewriteEngine on
       </IfModule>
   
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
   
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^mywebsite.co.uk [NC]
       RewriteRule ^(.*)$ https://www.myswebsiye.co.uk/$1 [L,R=301]
   
       RewriteCond %{HTTP_HOST} ^mywebsite\.co\.uk$ [OR]
       RewriteCond %{HTTP_HOST} ^www\.mywebsite\.co\.uk$
       RewriteRule ^index\.html$ "https\:\/\/www\.mywebsite\.co\.uk\/" [R=301,L]
       ```
   
 * The sitewide ridrect works well but if someone did type [http://www.mysite.com/pagetwo/](http://www.mysite.com/pagetwo/)
   it wouldn’t redirect to the https version basically i need to do a redirect for
   each page
 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7637001)
 * Ahh.. try moving the WordPress stuff to the bottom.
 *     ```
       RewriteOptions inherit
       <IfModule LiteSpeed>
       RewriteEngine on
       </IfModule>
   
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{HTTP_HOST} ^mywebsite.co.uk [NC]
       RewriteRule ^(.*)$ https://www.myswebsiye.co.uk/$1 [L,R=301]
   
       RewriteCond %{HTTP_HOST} ^mywebsite\.co\.uk$ [OR]
       RewriteCond %{HTTP_HOST} ^www\.mywebsite\.co\.uk$
       RewriteRule ^index\.html$ "https\:\/\/www\.mywebsite\.co\.uk\/" [R=301,L]
   
       # BEGIN WordPress
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 *  Thread Starter [timmer81](https://wordpress.org/support/users/timmer81/)
 * (@timmer81)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7637011)
 * This seems to have solved the issue, big thanks to you! But the only other issue
   is if I type
    `www.mywebsite.co.uk` it forwards to this `https://.www.myswebsite.
   co.uk/` error page reads This site can’t be reached
 * .www.mywebsite.co.uk’s server DNS address could not be found.
    DNS_PROBE_FINISHED_NXDOMAIN
 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7637018)
 * Try and change this line:
 *     ```
       RewriteRule ^index\.html$ "https\:\/\/www\.mywebsite\.co\.uk\/" [R=301,L]
       ```
   
 * To:
 *     ```
       RewriteRule ^index\.html$ https://www\.mywebsite\.co\.uk/ [R=301,L]
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘301 redirect from http to https page level’ is closed to new replies.

## Tags

 * [301 redirect](https://wordpress.org/support/topic-tag/301-redirect/)
 * [HTTP](https://wordpress.org/support/topic-tag/http/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [MarkRH](https://wordpress.org/support/users/markrh/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/301-redirect-from-http-to-https-page-level/#post-7637018)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
