Enabling httpS

Permalink
Guys,

A customer wants to use https and I have enabled it on the hosting package.
However not httpS appears in the URL. I have contacted my host who tell me:
===============
Thanks for the reply. The shared secure server is setup and active on this account but at the moment your rewrites are directing this back to usehttp://www.logicallysecure.com/logicallysecure.com/... when browsed to, I would advise reviewing all rewrites setup on this account as they appear to be causing the issue at the moment.
===================

I gather from other posts that ammends to the .htaccess or site.php file are required but there seems to be no simple solution.

Does anybody know one please?

Ian

igrieves
 
ntgross replied on at Permalink Reply
ntgross
If you want to force HTTPS in the URL for the entire site - its fairly simple to do with a .htaccess re-write rule.

#HTTP to HTTPS redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


Replacing 'example' with your domain name.

But it could be more complicated depending on the hosting server's configuration.
igrieves replied on at Permalink Reply
igrieves
Hi,

Thanks for getting back to me. I have come across a similar code snippet before but tried yours today.

I already have the pretty url code in my .htaccess file so added your to the bottom making the appropriate changes. See:

==============================

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule .* index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?logicallysecure\.com$
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$https://www.logicallysecure.com/$1... [R,L]

====================================

As before this took me to a https URL for the site but no site, only a blank page. I have put the site back as it's live.

I'm not a developer so can comment but I tihnk we are close to sorting this. There must be a re direct somewhere that will finally make this work. What do you think?

Ian
andrew replied on at Permalink Best Answer Reply
andrew
I think there might be a server misconfiguration issue. If the server is setup correctly, there shouldn't be any difference with

http://yoursite.com

andhttp://yoursite.com.

The most you'd get would be an SSL certificate error in the browser, or - if the redirect code wasn't setup properly, you might get a notification that you've been redirected too many times and your browser is going to stop loading the page. The white page makes me think that your server potentially has a completely separate directory for "secure files" aka your site at https:// vs. your regular site at http://.

For example, some setups have www/ directories and secure_www/ directories (or named something similar). When you visit at http:// you show the site found in the www/ directory; when you visit at https:// directory you go to a different location. Check on that - you may need a separate concrete5 install or a symlink at the location that points to the main website.
igrieves replied on at Permalink Reply
igrieves
Many thanks Andrew.

This is steep learning curve for me so please excuse my ignorance. I'll investigate with my host today and let you know.

Ian
igrieves replied on at Permalink Reply
igrieves
Andrew,

You were quite right - it is a shared server so a whole new URL was required. They did do custom SSL Certificates though which cover it.

Thank You.

Ian