这是我当前的 .htaccess 文件:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Force https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Header set X-UA-Compatible "IE=Edge,chrome=1"
# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
当没有斜杠时,我该怎么做才能强制使用斜杠?例如,我当前的 URL 如下所示:
https://amemoirproject.com/chapters/quarter-after
我想强制使用斜杠,使它们看起来像这样:
https://amemoirproject.com/chapters/quarter-after/