I want to redirect website from https to http 302. I am using below code:

    RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTPS} on
RewriteRule ^/?$ http://%{www.example.com}/ [L,R=302]

But it is not working. How can I do?

1 Answer 1


You can add below code in your project root .htaccess file.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^(.*) http://www.domain.com%{REQUEST_URI} [R=302,NC]
  • I have tried multiple times. Oct 6, 2017 at 10:00
  • 1
    May be in your htaccess file write other rules that will redirect your url to "http to https" after adding above code. Oct 6, 2017 at 10:04
  • He wants to 302 redirect not 301
    – jscar
    Oct 6, 2017 at 10:40
  • 1
    I have edited my answer. Please check it. Oct 6, 2017 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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