Last active
February 14, 2023 13:29
-
-
Save alrnz/b23f1384dd4def9ca054 to your computer and use it in GitHub Desktop.
[Mittwald htaccess] htaccess rules for Mittwald standard domains #htaccess #Mittwald
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mittwaldserver umleiten | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^.*\.mittwaldserver\.info [NC,OR] | |
RewriteCond %{HTTP_HOST} ^.*\.webspaceconfig\.de [NC] | |
RewriteCond %{HTTPS}s ^on(s)| | |
# # Zugriff verbieten (403 Fehler) (einfacher einzubinden, reicht für SEO) | |
# RewriteRule ^.* - [F] | |
# # umleiten auf andere Domain (besser für User) | |
RewriteRule ^ http%1://www.DOMAIN.de/$1 [R=301,L] | |
# ---------------------------------------------------------------------- | |
# | Forcing `https://` | | |
# ---------------------------------------------------------------------- | |
# Redirect from the `http://` to the `https://` version of the URL. | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# does not work on my mittwald-server | |
#RewriteCond %{HTTPS} !=on | |
# use this check instead | |
RewriteCond %{SERVER_PORT} ^80$ | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing!