0

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?

2

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]
4
  • I have tried multiple times. Oct 6 '17 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 '17 at 10:04
  • He wants to 302 redirect not 301
    – jscar
    Oct 6 '17 at 10:40
  • 1
    I have edited my answer. Please check it. Oct 6 '17 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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