简体   繁体   中英

Redirect site from https to http using htaccess or any other way

I tried all the answers mentioned on a search engine for redirecting site from https to http but these are not working for me.

I tried: How do you redirect HTTPS to HTTP? and http://wp-mix.com/htaccess-redirect-http-to-https/ all methods here

Let me explain little more here:

Before my site (combustiondepot.com) is the separate site and having ssl installed there. Everything is working fine that time. After that we deleted the main combustiondepot.com site and make it addon domain for our main domain industrialstores.com.

Now site is working fine except for https. Whatever I changes I am making in htaccess or php these are of no use.

The examples above work if you have .htaccess allowed in your config. Allow Override

If you want to do it using code you could do something like this assuming your using php.

<?php
if  ( $_SERVER['HTTPS'] )
    {
            $host = $_SERVER['HTTP_HOST'];
            $request_uri = $_SERVER['REQUEST_URI'];
            $good_url = "http://" . $host . $request_uri;

            header( "HTTP/1.1 301 Moved Permanently" );
            header( "Location: $good_url" );
            exit;
    }
?> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM