Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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". –  Michael Hampton Sep 4 '12 at 18:02
add comment

1 Answer

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]
share|improve this answer
    
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. –  Dilip Sep 5 '12 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. –  Logic Wreck Sep 5 '12 at 13:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.