Fix htaccess
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
s3lph 2023-01-06 00:38:18 +01:00
parent 1022fd7fb0
commit fd3da4df78
Signed by: s3lph
GPG key ID: 8AC98A811E5BEFF5
3 changed files with 2 additions and 9 deletions

View file

@ -11,7 +11,6 @@ jinja_environment:
baseurl_abs: https://chaostreff.ch/
baseurl: /
spaceapi_proxy_endpoint: /spaceapi-proxy
htaccess_language_redirect: no
htaccess_spaceapi_proxy: yes
hackerspaces:

View file

@ -4,18 +4,12 @@ DirectoryIndex index.var index.html
# Optional: Redirect to language specific subsite, rather than showing
# language specific content at the root
{% if htaccess_language_redirect %}
{%- for language in languages %}
Redirect /index.{{ language }}.html /{{ language }}/
{%- endfor %}
{%- endif %}
{% if htaccess_spaceapi_proxy %}
# SpaceAPI proxy service workaround for missing CORS headers
RewriteEngine on
{%- for space in hackerspaces %}
{%- if 'spaceapi' in space %}
RewriteRule ^/spaceapi-proxy{{ space.spaceapi }}$ {{ space.spaceapi.split('/', 2)[1] }}://{{ space.spaceapi.split('/', 2)[2] }} [P,L]
RewriteRule ^spaceapi-proxy{{ space.spaceapi }}$ {{ space.spaceapi.split('/', 2)[1] }}://{{ space.spaceapi.split('/', 2)[2] }} [P,L]
{%- endif %}
{%- endfor %}
{%- endif %}

View file

@ -1,7 +1,7 @@
URI: index; vary="language"
{% for language in languages %}
URI: index.{{ language }}.html
URI: {{ language }}/index.html
Content-Type: text/html
Content-Language: {{ language }}
{% endfor %}