Jump to content
  • 0

How To Force Ssl?


racetoni2

Question

Recommended Posts

  • 1

The .htaccess file included with Blesta already contains a rule to force HTTPS, which is commented out by default. Simply remove the # symbol at the beginning of these lines

# Force HTTPS
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]

i.e.

# Force HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]
Link to comment
Share on other sites

  • 0

OK, So i try that already. I open the. htaccess file. It was blank. So i added the wholes entire lines in there and is not forcing SSL.

 

Do you have teamviewer and I can look with you or are you using a control panel (If you use a non control panel do you have allowoveride All?)

Link to comment
Share on other sites

  • 0

Here is the apache config. Mod rewrite enbled:

 

<VirtualHost my.netstreet.co.za:443>

     SSLEngine On

     SSLCertificateFile /etc/apache2/ssl/*.netstreet.co.za.crt

     SSLCertificateKeyFile /etc/apache2/ssl/*.netstreet.co.za.key

     SSLCACertificateFile /etc/apache2/ssl/geotrust.cer

 

     ServerName my.netstreet.co.za

     DocumentRoot "/var/www/Netstreet/my"

     ErrorLog ${APACHE_LOG_DIR}/error.log

 

<Directory "/var/www/Netstreet/my">

    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

</VirtualHost>

Link to comment
Share on other sites

  • 0

Here is the apache config. Mod rewrite enbled:

 

<VirtualHost my.netstreet.co.za:443>

     SSLEngine On

     SSLCertificateFile /etc/apache2/ssl/*.netstreet.co.za.crt

     SSLCertificateKeyFile /etc/apache2/ssl/*.netstreet.co.za.key

     SSLCACertificateFile /etc/apache2/ssl/geotrust.cer

 

     ServerName my.netstreet.co.za

     DocumentRoot "/var/www/Netstreet/my"

     ErrorLog ${APACHE_LOG_DIR}/error.log

 

<Directory "/var/www/Netstreet/my">

    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

</VirtualHost>

 

not enabled on the http.d configuration.

Link to comment
Share on other sites

  • 0
i believe mod_spdy

 

 

########################################################

# package:    minPHP

# filename:   .htaccess

########################################################

 

<Files ~ "\.(pdt)$">

   order deny,allow

   deny from all

</Files>

 

# Protect against Clickjacking

#Header append X-Frame-Options "SAMEORIGIN"

 

RewriteEngine on

 

# Force HTTPS

#RewriteCond %{HTTPS} !=on

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]

 

RewriteCond %{REQUEST_FILENAME} !-d

 

RewriteCond %{REQUEST_FILENAME} !-f

 

 

RewriteRule ^(.*)$ index.php

 

 

 

RewriteCond %{REQUEST_URI} ^(.*)/install.php$

 

RewriteRule install.php %1/install/ [R=301,L]

Link to comment
Share on other sites

  • 0

Did that already and still getting the same error

ok comment them both out and try your blesta, try it with http:// see if it redirects to https:// if so you are using HTST

 

If it fails try:

RewriteEngine   On
RewriteCond     %{HTTPS}        off
RewriteCond     %{SERVER_PORT}  ^80$ [NC]
RewriteRule     (.*)    https://%{HTTP_HOST}%{REQUEST_URI}

If that fails try:

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com [NC]
RewriteCond %{REQUEST_URI} ^/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]

replacing domain.com with whatever your blesta is e.g.:

RewriteCond %{HTTP_HOST} ^(www\.)?licensecart\.com/billing/ [NC]
RewriteCond %{REQUEST_URI} !^/dl.php [NC]
RewriteCond %{REQUEST_URI} ^/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://licensecart.com/billing/$1 [R=301,L]

If it's none of them I'm out of ideas.

Link to comment
Share on other sites

  • 0

 

I have solve the PROBLEM>>>>>> OMG!!!!!!!

Ok I took out the old code and replace it with the following:

 

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

 

 

Well done mate never heard of HTTP:X-Forwarded-Proto before.

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
Answer this question...

×   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.

Loading...
×
×
  • Create New...