-5

So my domain is www.urtina.com and as u can see whenever you go on that link it will get HTTP (without padlock) but if you go to any other link it will be HTTPS. Only my homepage goes through HTTP.

Important things to mention is that I use Apache. Every my attempt to edit .htaccess file ends up by website stoping to work. My whole website is hosted on AWS (Elastic Load Balancer and Ec2 instance) and that is where I derived my SSL certificate.

I want to make that homepage load in HTTPS as well. I believe that the problem is eather in .htaccess content or in Elastic Load Balancer (causes a loop and my web-page wont load because of too much redirects ) How should I do that . Here is my app folder and place where I created my .htaccess file I would appreciate your help.

  • You need to set up a 301 forward from the http to the https versinon of the home page, in Apache. Alternately you can force https in the ELB. – Tim Feb 06 '17 at 00:40
  • I'm going to explain why you've been voted down and your question will probably be closed: it's incredibly simple and you don't appear to have made any effort to work this out yourself. The AWS documentation or any basic Apache HTTPS tutorial will teach you how to do this. Server Fault is primarily to help people with the difficult problems, not to teach people the basics. – Tim Feb 06 '17 at 01:07

2 Answers2

1

Enable to listen ssl connection bro Check again u have enabled

sudo nano /etc/apache2/sites-available/default-ssl.conf
sudo a2ensite default-ssl.conf

then restart apache2

A sample .htaccess attached here

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{SERVER_PORT} !^443$
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>

For detailed doc check https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04

Ashish Gupta
  • 175
  • 1
  • 6
0

If you want force HTTPS redirection, add the following to the top of the /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

After modifying the Apache configuration files, restart Apache to apply the changes.

chicks
  • 3,639
  • 10
  • 26
  • 36