Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've been trying to redirect web traffic from HTTP to HTTPS by adding the line to the httpd.conf file:

Redirect permanent /

but to no avail. The browser response is Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

I understand that it works for domain names but my server doesn't use one. Is there any way around this/what am I doing wrong.

share|improve this question
Have you configured Apache to listen on port 443 and referenced an SSL certificate? Please post the host configuration from httpd.conf – Mathias R. Jessen Jan 23 '12 at 22:42
One of the problems with using a permanent redirect is that Firefox will cache it. (Maybe not the redirect delivered over SSL but definitely the one delivered over non-SSL.) Even once you fix this problem, Firefox will continue to give you that error message until you clear that part of its cache. Use curl -I to check what response code you get back without having to worry about caching. – Ladadadada Jan 23 '12 at 22:53
@JudasIscariot1651 Yes SSL certificate is installed and when I enter 'https://'' in browser it works no problem. I want 'http://' to redirect to https://... – wonderswan Jan 23 '12 at 22:55
up vote 5 down vote accepted

I suspect that your Redirect line is in a part of the config file that affects both the SSL and non-SSL parts. Therefore, even when you request the SSL version you still get a redirect to the SSL version.

If you have a part of the config file that is for non-SSL only, move the Redirect there. If not, convert it to a RewriteRule and use a RewriteCond in front of it like this:

RewriteCond %{HTTPS} off
RewriteRule / [R=301]
share|improve this answer
Thank you I'm so grateful – wonderswan Jan 23 '12 at 23:30

Apache has a special page titled "When not to use mod_rewrite"

Follow their examples

To redirect http URLs to https, do the following:

<VirtualHost *:80>
    Redirect "/" ""
</VirtualHost >

<VirtualHost *:443>
    # ... SSL configuration goes here
</VirtualHost >
share|improve this answer

Use mod_rewrite:

   RewriteEngine On
   RewriteCond %{SERVER_PORT} 80
   RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]
share|improve this answer
Thank you for your help – wonderswan Jan 23 '12 at 23:30

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.