mod_rewrite to redir http to https

Apache, Lighttpd, nginx, Cherokee
Post Reply
eth
Posts: 5
Joined: 2005-02-03 01:09
 

mod_rewrite to redir http to https

Post by eth »

Also ich fasse mich kurz, ich will einen apache2-vhost mit http auf einen vhost mit https umleiten... weiss wer wie das geht?

Ich danke im Voraus :)

Debian Woody
Apache2 2.0.52
superuser1
Posts: 291
Joined: 2003-11-26 18:43
Location: earth
 

Re: mod_rewrite to redir http to https

Post by superuser1 »

Hi...

http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html

In den entsprechenden VHost folgendes eintragen:

Code: Select all

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.de/$1 [R]
:roll:
eth
Posts: 5
Joined: 2005-02-03 01:09
 

Dankööö

Post by eth »

Oki, ich danke, ich hätt da jetzt wieder stundenlang dran rumgewerkelt, also nochmal vielen dank :)
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: mod_rewrite to redir http to https

Post by Joe User »

Code: Select all

<VirtualHost *:80>
    ServerName www.domain.tld
    Redirect permanent / https://www.domain.tld/
</VirtualHost>
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Post Reply