forked from movsim/traffic-simulation-de
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess_examples
More file actions
58 lines (42 loc) · 2.02 KB
/
.htaccess_examples
File metadata and controls
58 lines (42 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# https://www.ionos.de/digitalguide/hosting/hosting-technik/htaccess-tricks/
#############################################
# (1) Fehlermeldungen
#############################################
# Eigene Fehlermeldungen lokaler Speicherort ( / = root-Verz der Webseite)
#ErrorDocument 404 /errorMsg/404.html
# Eigene Fehlermeldungen externer Speicherort
# (https oder http vermeiden, sucht sich dann aus; www besser als ohne)
ErrorDocument 404 www.traffic-simulation.de/Fehlermeldungen/toterLink.html
#############################################
# (2) Weiterleitungen
#############################################
# Folgende Zeile immer notwendig fuer rewrites,
#ACHTUNG: Macht ionos von sich aus anscheinend, da ich Fehlermeldungen
#bekam "This webpage has a redirect loop"
RewriteEngine On
# Aktiviere https:
# alle http-Anfragen (Port 80 !=Port 443) werden auf https umgeleitet
# Achtung: ohne $ nach 443, wie mancherorts steht, sonst geht nix!
# Achtung: https://www statt https:// bringt nix, wird anscheinend
# bei Ionos intern wieder ueberschrieben
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://traffic-simulation.de/$1 [R=301,L]
# alle Namen (wenn nicht direkt geaender, besser!)
# werden auf https ohne www umgeleitet
# R=301=permanentes Rewrite (302 waere temporaer),
# das L ("last") beendet die rule
#RewriteCond %{HTTP_HOST} ^traffic-simulation\.de [NC]
#RewriteRule (.*) traffic-simulation.de/$1 [R=301,L]
# alle Anfragen werden auf die Variante mit www umgeleitet
# (Einheitlichkeit soll gut fuer Suchmaschinen sein)
# (warum . bei rule nicht escaped? warum ! davor? warum $ statt [NC]?
RewriteCond %{HTTP_HOST} !^www.traffic-simulation.de$
RewriteRule ^(.*)$ https://www.traffic-simulation.de/$1 [R=301,L]
#############################################
# (3) Passwoertschutz (auch in .htpasswd moeglich?)
#############################################
AuthType Basic
AuthName "Passwortgeschützter Bereich"
AuthUserFile /<absoluter Pfad zur Passwortdatei>/.htpasswd
AuthPGAuthoritative Off
require user User1 User2 User3