Welcome to TalkGraphics.com
Results 1 to 7 of 7
  1. #1

    Default HTTP to HTTPS redirection

    Hi all

    Sorry if this is simple and I should be chastised for not looking harder.

    I have a web site written I Xara. Works fine!
    I paid my host to implement HTTPS on their end, It works if you enter HTTPS:// my website domain

    How ever a search shows the HTTP version and I want to force a redirection to HTTPS

    No idea how to do it? Is it something I add in the settings or do I need to write some code or what?

    Many Thanks

    Tim

  2. #2
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,775

    Default Re: HTTP to HTTPS redirection

    I do mine by adding a .htaccess file to the public_html folder (same place as you upload your site to). An .htaccess file is a text file created in Notepad or similar with the file extension (.txt) removed and are literally named .htaccess.
    I have seen different versions that achieve the same job, but mine is:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    Click image for larger version. 

Name:	htaccess.jpg 
Views:	36 
Size:	15.9 KB 
ID:	130594

  3. #3
    Join Date
    Jun 2012
    Location
    CZECH
    Posts
    147

    Default Re: HTTP to HTTPS redirection

    This code works for me, it's useful if you have subdomains.

    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,NE,L]
    ____________________________
    __I am sorry for my bad English__

    P&G 10, 11, 15; XWD Premium 11,15; XDPX 15.1; XDPX 18.5; XDPX 19; XBuilder;

  4. #4

    Default Re: HTTP to HTTPS redirection

    Thanks

    Just to be sure I can use the code as is? No need to add URL names eg mywebsite.com

    Tim

  5. #5
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,775

    Default Re: HTTP to HTTPS redirection

    Quote Originally Posted by TimBox View Post
    Thanks

    Just to be sure I can use the code as is? No need to add URL names eg mywebsite.com

    Tim
    Speaking for my post only...fine as is, just copy/paste.

  6. #6

    Default Re: HTTP to HTTPS redirection

    YAY!!!!!

    As always chaps great advice and you fixed my issue. Works a treat. Many many thanks...

    Tim

  7. #7

    Default Re: HTTP to HTTPS redirection

    Quote Originally Posted by TimBox View Post
    YAY!!!!!

    As always chaps great advice and you fixed my issue. Works a treat. Many many thanks...

    Tim
    Hey, just one other thing you might want to check (and I'm sure there will be an answer on this forum somewhere).

    I had this redirect issue - my site showed https and also http (and Google saw them as two different sites). I also had an issue where I had www.mysitename.co.uk and mysitename.co.uk. This was a real pain as, if I understand it correctly, Google saw four sites all duplicated;

    https://www.mysitename.co.uk
    http://www.mysitename.co.uk
    https://mysitename.co.uk and
    http://mysitename.co.uk.


    My issues are all solved - but I know I hadn't realised all of these problems were there. Hopefully you don't have this issue, but I thought it was closely related and worth mentioning.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •