Title: Forcing HTTPS AND www
Last modified: November 26, 2016

---

# Forcing HTTPS AND www

 *  [algraham93](https://wordpress.org/support/users/algraham93/)
 * (@algraham93)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/forcing-https-and-www/)
 * Hello,
 * Been having the same trouble for a while and nowhere seems to help. The website
   has an SSL certificate installed and works perfectly on https:// UNTIL you try
   and access the website directly without www.
 * Example:
 * [http://www.example.com](http://www.example.com) redirects to [https://www.example.com](https://www.example.com)
 * example.com/example doesn’t redirect to [https://www.example.com/example](https://www.example.com/example)
 * But when [https://example.com/example](https://example.com/example) is typed 
   in, it works? Can someone help as this is messing up people accessing https through
   googles displayed sitelinks.

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

 *  [Ashar Irfan](https://wordpress.org/support/users/mrasharirfan/)
 * (@mrasharirfan)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/forcing-https-and-www/#post-8483465)
 * Hi,
 * Maybe you can try forcing https protocol on your URL. Use the following code 
   in your .htaccess file to force https on your website.
 *     ```
       RewriteEngine On
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
       ```
   
 * You can also read this article from [SiteGround](https://www.siteground.com) 
   on [How to force SSL with .htaccess](https://www.siteground.com/kb/how-to-force-ssl-with-htaccess/).
 * Cheers!
 *  Thread Starter [algraham93](https://wordpress.org/support/users/algraham93/)
 * (@algraham93)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/forcing-https-and-www/#post-8488585)
 * Hi!
 * Thanks for your reply! It didn’t work still. When I type in domain.com it redirects
   to https and www perfectly. But when I type in domain.com/example it goes to 
   www fine but not https although the page is infact https.
 * Any ideas?

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

The topic ‘Forcing HTTPS AND www’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [algraham93](https://wordpress.org/support/users/algraham93/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/forcing-https-and-www/#post-8488585)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
