更新时间:2023-09-28 22:58:10
只要最后的斜线可选的:
Just make the trailing slash optional:
RewriteRule ^videos/login/?$ /videos/login.php
不过,你***只使用一个变体(带或不带斜线)和重定向一个到另一个:
But you should better use just one variant (with or without trailing slash) and redirect one to the other:
# add trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ /$0/ [L,R=301]
# remove trailing slash
RewriteRule (.*)/$ /$1 [L,R=301]