Redirect http to https URL and vice versa by .htaccess

Some times we need to redirect our all simple http urls to https urls and vice versa . So i think the .htaccess is the best solution to do that . Today i am going to tell you guys How we can do this job with few lines of code in .htaccess file. Here is the code
Redirect https to http
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Redirect http to https
RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
More from my site

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request
Thanks , It helped me
Worked like a charm . Thanks Buddy