Take the 2-minute tour ×

I have searched everywhere and still can't find any answers.

I'm trying to redirect eg: https://www.domain.com to http://www.domain.com

Currently I have a .htaccess file which includes:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} ^443$ [OR]
RewriteCond %{HTTPS} =on

But I keep receiving the following error:

An error occurred during a connection to www.domain.com.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)...

Do I need to add anything to my vhost file for VirtualHost *:443? for domain.com - Apologies, quite new to this. Any help/direction would be greatly appreciated, thanks!

share|improve this question
Could be many things, but to help you narrow it, usually SSL errors appears before it even reach htaccess. Browser answers regarding SSL are provided before htaccess instructions (I think). This site may help you errorhelp.com/search/details/69648/ssl_error_rx_record_too_long –  ecchymose Jun 1 '11 at 19:02
add comment

1 Answer

You need to have fully working https vhost. Please paste here what you have in your vhost.

<VirtualHost IP:443>
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/www.domain.com.crt
    SSLCertificateKeyFile /etc/ssl/private/www.domain.key

    ReWriteEngine On
    RewriteRule (.*) http://www.domain.com%{REQUEST_URI}

If you have the same vhost for http and https things can get messy. Btw your cert must have CNAME for www.domain.com or if you have wildcard *.domain.com. And one more thing, you don't need any RewriteCond here because you rewrite every https request.

share|improve this answer
add comment

Your Answer


