Jump to content

SSL certs and www.


Recommended Posts

Hi

 

A basic question for most people here hehe.

 

When visiting my website with https with www. you are promted that the site may not be trusted, blah blah blah.. as the certificate is for hosting4network and not www.hosting4network.co.uk .

 

So, is there anything I should change in my cert to remove this promt from appearing for those that use www.

 

I'm thinking that if I change it so the domain is www.hosting4network.co.uk , the error will appear on any domains without www. - is that what will happen?

 

If not then I assume I would need 2 SSL certs or something?

 

Thanks for your help,

Link to comment
Share on other sites

Your assumption is correct.

 

However, if you want, you can use some simple .htaccess to send all users using "https://www.domain.com" to "https://domain.com"

 

There are a few ways to do this, but this is the easiest:

 

RewriteCond %{HTTPS} ==on

RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]

 

with the above you could add another condition so it only checks when it;s got the www in it.

RewriteCond %{HTTP_HOST} !^www.domain.com$

 

 

Or, you can also use this to redirect all www. to just the domain:

 

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]

RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Link to comment
Share on other sites

Hmm, it's not working for me :(

 

I assume I change domain.com to my domain ? I've saved, restarted browser, and it still doesn't change/remove the www. with or without www.

 

RewriteCond %{HTTPS} ==on
RewriteRule ^(.*)$ https://hosting4network.co.uk/$1 [L,R=301]

 

That right?

 

I'm thinking of forcing https on all pages, so I assume it would be done in .htaccess - how would I do this?

 

Thanks for your help guys, kind of a newbie at .htaccess.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated