【发布时间】:2022-01-25 11:55:35
【问题描述】:
我有这个 htaccess 代码删除了我的 URL 的 .html 扩展名,但我想在删除 .html 扩展名后在 URL 的末尾添加 /,我该怎么做?
这是我的代码:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
【问题讨论】:
-
末尾的斜线表示您的文件现在是目录而不是文件。你确定这是你想做的吗?
标签: apache .htaccess url mod-rewrite seo