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_abs: https://chaostreff.ch/
baseurl: / baseurl: /
spaceapi_proxy_endpoint: /spaceapi-proxy spaceapi_proxy_endpoint: /spaceapi-proxy
htaccess_language_redirect: no
htaccess_spaceapi_proxy: yes htaccess_spaceapi_proxy: yes
hackerspaces: hackerspaces:

View file

@ -4,18 +4,12 @@ DirectoryIndex index.var index.html
# Optional: Redirect to language specific subsite, rather than showing # Optional: Redirect to language specific subsite, rather than showing
# language specific content at the root # 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 %} {% if htaccess_spaceapi_proxy %}
# SpaceAPI proxy service workaround for missing CORS headers # SpaceAPI proxy service workaround for missing CORS headers
RewriteEngine on RewriteEngine on
{%- for space in hackerspaces %} {%- for space in hackerspaces %}
{%- if 'spaceapi' in space %} {%- 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 %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}

View file

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