I'm currently trying to force http://sub.domain.com redirection to https://sub.domain.com.

I tried to use

<VirtualHost *:80>
    Redirect permanent / https://sub.domain.com/

aswell as

<VirtualHost *:80>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Both are working well in Firefox & Chrome. If I put http://sub.domain.com it redirects to https://sub.domain.com. If I remove the "s" from the URL bar manually and "Enter", it still redirects to https automatically.

Problem: While using incognito mode on Firefox & Chrome and normal mode in Internet Explorer, when I type sub.domain.com it doesn't redirect to https://sub.domain.com

Question: Is there any rule to apply to make it work in every case?

Thanks a lot.

  • Turn on your logs for mod_rewrite with something like "LogLevel debug rewrite:trace3". – ColtonCat Mar 8 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.