boozi
boozi

Reputation: 506

Showing HTTPS content in HTTP site, using RewriteRule

I have two domains, DomainA and DomainB - they are hosted separately. DomainB is secure with SSL, while DomainA is not. I want that if a user enters http://DomainA.com/donation he will see the content of the secured https://DomainB.com without any redirects. I figured that maybe Redirect rule will do the trick (I searched both Google and Stackoverflow, with no luck)

I wrote the following RewriteRule in DomainA .htaccess

RewriteCond %{HTTP_HOST} ^DomainA.com/donation
RewriteRule ^(.*) https://DomainB.com/$1 [P]

My question is - The SSL of DomainB will still work? Let's say a user will enter DomainA.com/donation, what will he see? the secured content of DomainB with the certificate as usual? If not, it means that the only way to keep DomainB certificate is to redirect the whole page of DomainA using [R=301] ?

I can't check it live due to the request of my client.

Upvotes: 0

Views: 36

Answers (1)

Croises
Croises

Reputation: 18671

SSL is also provided to prevent precisely this sort of thing. So I hope this is not possible.

You can use that in your http://DomainA.com root .htaccess:

RewriteEngine on
RewriteRule ^donation/? https://DomainB.com/ [NC,R=301]

Upvotes: 0

Related Questions