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.

0

1 Answer 1

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]

Not the answer you're looking for? Browse other questions tagged .