Skip to content

Commit

Permalink
Add CORS rules for th-koeln.de access
Browse files Browse the repository at this point in the history
  • Loading branch information
cnoss committed Dec 4, 2024
1 parent 1e4d27d commit 4417543
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions static/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.medieninformatik.th-koeln.de/%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.medieninformatik.th-koeln.de/%{REQUEST_URI} [R=301,L]

# Prüfen, ob die Origin eine Subdomain von th-koeln.de ist
RewriteCond %{HTTP:Origin} ^https://([a-z0-9-]+\.)?th-koeln\.de$ [NC]
RewriteCond %{REQUEST_METHOD} GET
RewriteRule .* - [E=ORIGIN:%{HTTP:Origin}]

# CORS-Header nur setzen, wenn die Bedingungen erfüllt sind
Header set Access-Control-Allow-Origin "%{ORIGIN}e" env=ORIGIN
Header set Access-Control-Allow-Methods "GET"
Header set Access-Control-Allow-Credentials "true"

0 comments on commit 4417543

Please sign in to comment.