Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure apache with SSL. I am facing 2 issues:

1) If typed it doesn't redirect to (Though, i have written the rewrite rule).

2)And while running it shows unauthorized label with https.

Here is a reference of how my apache configuration file look a like.

<VirtualHost *:443>


  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  RewriteRule ^(.*)$$1 [L,R=301]

  SSLEngine on


I have enabled my mod_ssl.

I would highly appreciate if anyone can throw some light on this.

share|improve this question
up vote 3 down vote accepted

I assume you're looking to redirect to In order to do that you'll need to have a VirtualHost instance listening on port 80 and put the rewrite rules there.

share|improve this answer
That worked. Thanks. The Second problem still persists. I checked domain SSL certificate which is fine. The problem i think here is that loads others resources like JS and CSS(say: which is not running over https. So, it gives a warning. What do you think? is this could be the issue? – aatifh Jun 20 '11 at 18:30
@aatifh - Yes. If current page uses HTTPS then site has to be on HTTPS as well. For that you would need to set it up on another IP:port combination .. or obtain wildcard SSL certificate that will cover both of these domains. Check this link: Is it really a security problem to have non secure assets on an ssl page? – LazyOne Jun 20 '11 at 23:01
LazyOne: Thanks a lot.:) – aatifh Jun 21 '11 at 6:33

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.