Skip to content

Commit

Permalink
Merge pull request #3831 from trwnh/fep
Browse files Browse the repository at this point in the history
FEP: Fix old redirects and remove unnecessary rules
  • Loading branch information
davidlehn committed Jan 19, 2024
2 parents dc913a1 + 96af64f commit e867445
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fep/.htaccess
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Headers DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified$
Options +FollowSymLinks
RewriteEngine on

# catch FEP-specific context requests
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([^/\.]*)/?(.*?)?/?$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1/context.jsonld [R=302,L]
RewriteRule ^([A-Za-z0-9]+)\/?(.*?)?$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1/context.jsonld [R=302,L]

# catch FEP-specific context requests without content negotiation
RewriteRule ^([^/\.]*)/?(.*?)?.jsonld$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1/context.jsonld [R=302,L]
RewriteRule ^([A-Za-z0-9]+).jsonld$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1/context.jsonld [R=302,L]

# catch FEP proposal documents
RewriteRule ^([^/\.]*)/?(.*?)?/?$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1/fep-$1.md [R=302,L]
RewriteRule ^([A-Za-z0-9]+)\/?$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1/fep-$1.md [R=302,L]

# catch root request
RewriteRule ^$ https://codeberg.org/fediverse/fep [R=302,L]

# a generic catch-all rule
RewriteRule ^(.*?)\/?$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1 [R=302,L]
RewriteRule ^(.*)\/?$ https://codeberg.org/fediverse/fep/raw/branch/main/fep/$1 [R=302,L]

0 comments on commit e867445

Please sign in to comment.