-2

I have a site with main domain www.solkey.ir.

I parked www.solkey.co but because main domain have ssl and park domain does not have ssl you can't open www.solkey.co (it shows an ssl security alert in browser like the picture below) .

I connected to my host and they said you have to redirect https://solkey.co >>>>> http://solkey.co in htaccess. but I don't know how to do it.

Below is my htaccess code.

how to redirect solkey.co(with https) to solkey.co(with http)

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress
HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
  • You can redirect from https to http, sure, but besides the missing security you will not get rid of that security warning in the initial requests that is to be redirected. Only those people immediately using the insecure http protocol will not get a warning. But in that case you do not need any redirection... – arkascha Jun 27 '17 at 05:47
  • 1
    The code you posted looks fine, but it does the opposite of what you describe it rewrites from http to https... – arkascha Jun 27 '17 at 05:48
  • the code is redirecting main domain . my problem is a code line to redirect park domain – behrad kiani Jun 27 '17 at 06:08
  • Well, you need to place similar rules as the first condition/rule pair at a location where that parked domain is served. In that host configuration or a dynamic configuration file. And you obviously need to turn around both: test for `=on` and redirect to `http` instead. What is the question with that? – arkascha Jun 27 '17 at 06:10

1 Answers1

0

You are bound to get an error as the other domain does not have the SSL Configuration. However there is an alternative to what you are trying to do. Instead of trying to setup a Rewrite rule at the server. You can configure Domain Forwarding as described here: https://in.godaddy.com/help/forward-a-domain-12123

Obviously, this feature exists for domains purchased via GoDaddy. I am assuming other DNS providers will have similar feature.

Kaushal Kumar Panday
  • 2,329
  • 13
  • 22