redirect to https

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

redirect to https

Post by mrwillow »

Hi,

I have my site built with WB14 - www.theavenuemotionpicturecompany.com - and have now purchased through my server an SSL certificate. It is configured correctly at their end, but to redirect from http to https somehow I need some kind of plug-in/instruction on what to do. I really do not know anything about this, and therefore, from the top, am asking you.

Please advise,

DC
User avatar
Pablo
 
Posts: 21573
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: redirect to https

Post by Pablo »

You will need to configure this on the server in .htaccess
User avatar
BaconFries
 
 
Posts: 5325
Joined: Thu Aug 16, 2007 7:32 pm

Re: redirect to https

Post by BaconFries »

To do a redirect will require the use of a 301 .htaccess file. Which you or your host can configure on the server. It will also require that the server runs Apache for it to work.

Code: Select all

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301]
User avatar
Williams
 
 
Posts: 102
Joined: Fri Nov 23, 2018 12:22 am
Contact:

Re: redirect to https

Post by Williams »

BaconFries wrote: Fri Aug 30, 2019 12:15 pm To do a redirect will require the use of a 301 .htaccess file. Which you or your host can configure on the server. It will also require that the server runs Apache for it to work.

Code: Select all

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301]


Here's another .htaccess file which's working for some servers

Code: Select all

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
You will need to replace example.com with your domain name.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Hi all,

And thank you, though this is over my head as currently presented. May I ask for a step-by-step guide?

D.
User avatar
Billywiz
 
 
Posts: 162
Joined: Thu Jul 17, 2008 3:32 pm
Location: UK
Contact:

Re: redirect to https

Post by Billywiz »

You can create an htaccess file by opening a .txt file in Notepad, copy and paste BF's code into it then click File >> Save as. In the pop-up dialogue, make sure to type .htaccess as the file name, choose 'ALL FILES' in the 'Save as type' box, finally click Save button.
In your project open File publisher and add the file then when you publish the htaccess will be in the root of your website
The Cheapest Car Hire, Worldwide.

Summit Car Hire
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Nope, sorry, not quite getting it. I've created a text file, c&p the code, closed the file, and manually renamed it ".htaccess" (and therefore it reads ".htaccess.txt"). Your next set of instructions are not clear to me. Am I supposed to add the code directly somewhere (in which case why would I need a txt file)? Or am I to attach the txt file somewhere - and if so, where?
User avatar
Billywiz
 
 
Posts: 162
Joined: Thu Jul 17, 2008 3:32 pm
Location: UK
Contact:

Re: redirect to https

Post by Billywiz »

Don't close and rename it, it will just be a text file. Follow the instructions step by step.

Can I contact you from your website, if so I will create an htaccess file for you and email it.
The Cheapest Car Hire, Worldwide.

Summit Car Hire
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Ok, get the first bit and have now done correctly. The second set of instructions don't make sense. I open WB14, then open the Publisher - ??? Do you mean open WB14, then the project file, then publish? But even then what to do exactly with the .htaccess file?
User avatar
Billywiz
 
 
Posts: 162
Joined: Thu Jul 17, 2008 3:32 pm
Location: UK
Contact:

Re: redirect to https

Post by Billywiz »

Toolbox >extensions>miscellaneous>File publisher
The Cheapest Car Hire, Worldwide.

Summit Car Hire
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Ok, there is a File Publisher Plus in the list, and I have now installed this. Do I then: i) from this Toolbox add this to just one, or every single, page within my Project? ii) open it and "Add Files", and locate the .htaccess file? iii) then publish the one page or entire website?
User avatar
Billywiz
 
 
Posts: 162
Joined: Thu Jul 17, 2008 3:32 pm
Location: UK
Contact:

Re: redirect to https

Post by Billywiz »

Drag "File Publisher" from Toolbox >>Miscellaneous not File Publisher Plus from "WYSIWYG web builder extensions" to your index page only, add .htaccess this will add it to the root of your website.
The Cheapest Car Hire, Worldwide.

Summit Car Hire
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

Can you log on to your cPanel on your server?
Since it's a one-off exercise you can just upload the .htaccess file (without the .txt) to the public_html folder (or whichever yours is) and that's it.
If it's not too late I would first check whether there is already an .htaccess file there, sometimes the host puts one there first.
If so you will have to append the new code to the existing one.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Ok, this has totally screwed up.

I followed the correct instructions, but forgot to adapt "yoursite.com". So now when loading my site yoursite.com shows up. So I redid after adapting the code to the below, republished, but yoursite.com still shows up. Just calling my server, 123-reg, and they say that their systems are indicating a content change - which is correct - but I have no idea how to update appropriately. You would think it's a simple re-publish, but it isn't. Here's the adapted code,

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.theavenuemotionpicturecompany\.com$ [NC]
RewriteRule ^(.*)$ https://www.theavenuemotionpicturecompany.com/$1 [L,R=301]
Last edited by mrwillow on Fri Aug 30, 2019 5:05 pm, edited 3 times in total.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

In my control panel there is both a File folder and a public_html folder, the latter within the former. Placing the .htaccess file in either one makes no difference to the current situation.

Help.
Last edited by mrwillow on Fri Aug 30, 2019 5:06 pm, edited 3 times in total.
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

FWIW, my .htaccess file is in the public_html folder.
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

I think you've missed the .com from the end of the url.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

This whole SSL situation has driven me crazy, particularly as it seems like money for old rope. Ok, yep - I then spotted the missing .com.

So, again - below is the revised code, placed in a .htaccess file, which is connected to my home page via File Publisher add-on, which uploads into the public_html folder within my main folder within the control panel. And the result is... yoursite.com still have it.

Help !

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.theavenuemotionpicturecompany\.com$ [NC]
RewriteRule ^(.*)$ https://www.theavenuemotionpicturecompany.com/$1 [L,R=301]
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

Clear your cache and reload the browser.
I have loaded your site and the https://... version now works.
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

Something is still wrong though.
The www and the http:// method should be automatically redirected to https:// but it isn’t.
Also I am now getting an error message “Too many redirects ...”
I am not an expert in .htaccess syntax so I can’t help there.
You could contact the host again unless anyone here can help.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Ok, I think problem solved. The second code offered earlier works, with adapting to my specific URL. And the .htaccess file must sit in the main folder, but not within the public_html folder. Can you please test at your end and confirm, thank you.
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Scrap that... the site is not secure. This is driving me nuts.
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

If you upload your site to the public_html folder then I would put the .htaccess file there (that's where mine is).
And delete (or remove the code) from the other version (in the root?).
The https:// works but it's just not redirecting www nor http://
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Do I use the first or second suggested code?
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

mrwillow wrote: Fri Aug 30, 2019 6:45 pm Do I use the first or second suggested code?
Sorry, I do not know enough about the syntax to advise you (I don't want to guess).
I would contact your host.
User avatar
rogerl
 
 
Posts: 196
Joined: Tue May 03, 2016 8:24 am

Re: redirect to https

Post by rogerl »

When I did mine I discovered the .htaccess file already existed and had other host related instructions in it. It was a hidden file, only visible via the control panel access, File Manager. I added the following code to the bottom of file then saved / Applied changes. Has worked ever since.

Code: Select all

RewriteEngine on

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ https://www.yourdomainname%{REQUEST_URI} [NE,L,R]
Just checking now and whatever you have done it seems to work fine here.
As a side comment your site took a while to load. Wondering if you need to optimize images or special effects in some way.
Interestingly in looking at the Team I found my twin in Ed Clee. Couldn't believe what i was seeing.
WWBman
 
 
Posts: 916
Joined: Fri Jan 08, 2010 6:10 pm

Re: redirect to https

Post by WWBman »

Yep, it's all being redirected correctly now.
What was the solution?
User avatar
rogerl
 
 
Posts: 196
Joined: Tue May 03, 2016 8:24 am

Re: redirect to https

Post by rogerl »

Perhaps time and a server refresh?
mrwillow
 
 
Posts: 57
Joined: Mon Jun 11, 2012 8:29 pm

Re: redirect to https

Post by mrwillow »

Hi all,

Thank you for your help. This was a headache (and for a site like mine an SSL certificate seems like money for old rope). Anyway, I have had a message from help at 123-Reg, and it looks like someone there rewrote the code. For future reference, it is the following. Thank you, D.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.theavenuemotionpicturecompany.com/$1 [R=301,L]
Post Reply