Skip to content

Instantly share code, notes, and snippets.

@alrnz
Last active February 14, 2023 13:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alrnz/b23f1384dd4def9ca054 to your computer and use it in GitHub Desktop.
Save alrnz/b23f1384dd4def9ca054 to your computer and use it in GitHub Desktop.
[Mittwald htaccess] htaccess rules for Mittwald standard domains #htaccess #Mittwald
# 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>
@mrflix
Copy link

mrflix commented Mar 7, 2022

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment