Remove trailing slashes from URLs
This commit is contained in:
parent
6d4667887d
commit
79f2473388
15
source/.htaccess
Normal file
15
source/.htaccess
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Options +FollowSymLinks -MultiViews
|
||||||
|
|
||||||
|
RewriteEngine on
|
||||||
|
|
||||||
|
# Remove trailing slashes from directories.
|
||||||
|
DirectorySlash Off
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
RewriteCond %{REQUEST_URI} !/$
|
||||||
|
RewriteCond %{REQUEST_FILENAME}/index.html -f
|
||||||
|
RewriteRule (.*) $1/index.html [L]
|
||||||
|
RewriteRule ^(.*)/$ /$1 [L,R=301]
|
||||||
|
|
||||||
|
# Remove index.html from URLs.
|
||||||
|
RewriteCond %{THE_REQUEST} \s/+(.*/)?index\.html[\s?] [NC]
|
||||||
|
RewriteRule ^(.*)index\.html$ /$1 [L,R=301]
|
|
@ -5,7 +5,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for zet in zets if related|filter((title) => title == zet.title) %}
|
{% for zet in zets if related|filter((title) => title == zet.title) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ zet.url }}">{{ zet.title }}</a>
|
<a href="{{ zet.url|trim('/', 'right') }}">{{ zet.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -7,7 +7,7 @@ use: [zets]
|
||||||
<ul>
|
<ul>
|
||||||
{% for zet in data.zets %}
|
{% for zet in data.zets %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ zet.url }}">
|
<a href="{{ zet.url|trim('/', 'right') }}">
|
||||||
{{- zet.date|date }}: {{ zet.title -}}
|
{{- zet.date|date }}: {{ zet.title -}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue