Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have a Debian/Linux Lenny LAMP server w/Plesk Panel 10.2. I have a PHP/MySQL webapp deployed in a Plesk "webspace".

I want to enforce SSL on site-wide.

Do I just forward port 80 to 443? For my single domain cert, do I forward to or do I forward to

Should this happen with .htaccess or some vhost config file?

share|improve this question

2 Answers 2

I would use mod_rewrite.

Enable mod_rewrite and add something like this to your vhost config

RewriteEngine on
RewriteCond %{HTTPS} !On
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
share|improve this answer

You can configure it in your vhost config. For example have a VirtualHost for the HTTP protocol on port 80 that redirects your users to the HTTPS version:

<VirtualHost *:80>
        Redirect /
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.