UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: info@upwork.link

Apache: .htaccess redirect from HTTP to HTTPS.

without comments

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^.*$ https://%1/$1 [R=301,L]

OR

RewriteEngine on
RewriteCondition %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] 

OR

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

OR

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

OR

If you’re using a load balancer you’ll need to use a different conditional. This works for AWS ELB:


    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule (.*) https://www.odesk.by/$1 [R=301,L]

Written by spectre

October 11th, 2013 at 10:28 pm

Leave a Reply

*