Redirect http to https apache on different port

I know that you can redirect 80 to 443 ssl, those are different ports. But in my case i want to serve everything on this port (82) via ssl. Maybe its possible to do it with playing custom error page since its showing an error page when i use http on this port but i don't know how

You can't host both encrypted and plain-text over the same port. If someone connects to the plain-text port say port 80 or 81, then you can forward them to your HTTPS port say 82 in this example. So something like this should do the trick:

# Plain-text rewrite:
<VirtualHost *:81>
DocumentRoot "/var/www/site"
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}:82%{REQUEST_URI}
<Directory "/var/www/site">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

# SSL config
<VirtualHost *:82>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/cert.pem
DocumentRoot "/var/www/site"
<Directory "/var/www/site">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

In this case any user connecting to port 81 would get forwarded to port 82. Anyone connecting to port 82 will be over SSL.