Kim
Kim

Reputation: 11

Rewrite from https to http

I have 5 sites on one apache server. One of the sites is with SSL. So when the other sites are accessed with https then they are redirected to the SSL site which is incorrect.

E.g.

https://x.com (with SSL)

http://y.com (normal site no SSL)

If I access https://y.com then I get the content from x.com. How can I fix so https://y.com just gets rewritten to http://y.com?

Upvotes: 1

Views: 637

Answers (2)

bisko
bisko

Reputation: 4078

In your .htaccess put:

RewriteCond %{HTTPS} on [NC]
RewriteRule ^(.*)$ http://y.com/$1 [R=301,L]

Upvotes: 1

Svisstack
Svisstack

Reputation: 16656

You can define it in apache config file. You must add a rule to connection incoming from https port.

If you are using linux, propably you have this config in /etc/apache2/sites-available/default-ssl.

If you don't have this file you must searching https virtualhost:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>

Upvotes: 0

Related Questions