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>
|
||||
{% for zet in zets if related|filter((title) => title == zet.title) %}
|
||||
<li>
|
||||
<a href="{{ zet.url }}">{{ zet.title }}</a>
|
||||
<a href="{{ zet.url|trim('/', 'right') }}">{{ zet.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -7,7 +7,7 @@ use: [zets]
|
|||
<ul>
|
||||
{% for zet in data.zets %}
|
||||
<li>
|
||||
<a href="{{ zet.url }}">
|
||||
<a href="{{ zet.url|trim('/', 'right') }}">
|
||||
{{- zet.date|date }}: {{ zet.title -}}
|
||||
</a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in a new issue