0

I have configured ELB with SSL certificate. Listener configuration for ELB is shown below -- 443 (HTTPS, Certificate: www.xyz.com) forwarding to 80 (HTTP), 80 (HTTP) forwarding to 80 (HTTP)

Domain Registrar setup with Godaddy CNAME record entry www

There is no entry for A-Name record with my domain xyz.com

Apache .htaccess setup

RewriteEngine on RewriteCond %{HTTP_HOST} ^xyz.com$ [NC] RewriteRule .* https://www.xyz.com [R=301,L] 

When I go to browser and type xyz.com it is not redirecting it to https://www.xyz.com When I type www.xyz.com, it is not redirecting it to https://www.xyz.com

I do not have any VirtualHost setup on ELB EC2 instances.

Can someone help me out to resolve this problem.

1
  • You didn't share your actual domain name, so you'll have to tell us exactly what happens when you go to "xyz.com" or "www.xyz.com". Commented Sep 4, 2012 at 18:02

1 Answer 1

0

Try something like this better under the existing virtual host configuration directive:

RewriteEngine on RewriteCond %{HTTPS} =off [OR] RewriteCond %{SERVER_NAME} !www.xyz.com RewriteRule ^.*$ https://www.xyz.com [R=301] 
2
  • I did this settings and I am getting -- Server error The webpage at xyz.com is currently unavailable. It may be overloaded or down for maintenance. Here are some suggestions: Reload this webpage later. HTTP Error 503 (Service Unavailable): The server is currently unable to handle the request. This code indicates this is a temporary condition, and the server will be up again after a delay. Commented Sep 5, 2012 at 8:06
  • This rule works as was tested. You need to check your other rules so to see that they don't interfere with this one. Commented Sep 5, 2012 at 13:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.