[PROBLEM] - Apache HTTPS Konfig
Results 1 to 3 of 3
  1. #1
    Ordovicium's Avatar
    Title
    Administrator
    Join Date
    Nov 2001
    Location
    Vienna, Austria, Austria
    Posts
    3,030
    Thanks
    23
    Thanked 108 Times in 47 Posts

    Question Apache HTTPS Konfig

    Wie muss die .htaccess Einstellung lauten, damit alles für die Hauptdomain an https weitergeleitet wird, aber die Sub-Domains weiterhin auf http bleiben können?
    lg Ordo

  2. #2
    emptyvi's Avatar
    Title
    Logo-Wettbewerb 2012, Platz 2.
    Join Date
    Mar 2008
    Location
    Ponyville
    Posts
    1,129
    Thanks
    603
    Thanked 694 Times in 390 Posts
    Hi!

    Geht vermutlich über RewriteRules (mod_rewrite) - such vielleicht mal in die Richtung, da gibt es vermutlich auch schon ein paar ähnliche Fragen auf StackOverflow.

    ¤¸¸.´¯`¸¸...>> Join the herd, join "My Little Pony @ TU-Wien" <<...¸¸´¯`.¸¸¤
    ¤¸¸.´¯`¸¸...>> (100% Twilight Sparkle approved) <<...¸¸´¯`.¸¸¤

    PP-Tutor WS2011 - WS2014
    EVC-Tutor SS2015


  3. #3
    Ordovicium's Avatar
    Title
    Administrator
    Join Date
    Nov 2001
    Location
    Vienna, Austria, Austria
    Posts
    3,030
    Thanks
    23
    Thanked 108 Times in 47 Posts
    Endlich was gefunden
    Code:
    RewriteEngine On
    RewriteBase /
    
    # www is redirected to base domain
    RewriteCond %{HTTP_HOST} ^www\.([^\.]+\.[^\.]+)$
    RewriteRule ^(.*)$ https://%1/$1 [L,R=301]
    
    # base domain should use HTTPS
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^[^\.]+\.[^\.]+$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
    
    # other domain should use HTTP
    RewriteCond %{HTTPS} on
    RewriteCond %{HTTP_HOST} !^[^\.]+\.[^\.]+$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
    Last edited by Ordovicium; 17-11-2017 at 02:05.
    lg Ordo

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •