0

I'm struggeling with the apache rewrite engine and need help to transform these address-variations:

http://www.site.de/index.php
www.site.de/index.php
http://site.de/index.php
site.de/index.php

to this form with www and https:

https://www.site.de/index.php

How would the statement look like and how does it work?

Currently it works from non-www to www:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^site.de [nc]
rewriterule ^(.*)$ https://www.site.de/$1 [r=301,nc]

But it ignores the https.

pguetschow
  • 101
  • 2

1 Answers1

0

Okay, I found the solution:

There must be a second rule like this:

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
pguetschow
  • 101
  • 2