Directing Non-Slash URL to Slash
问题 When I enter the website.com/seo link, I want to make a 301 redirect to the website.com/seo/ link. However, I don't want it to be broken in the codes I wrote in the current htaccess. my htacces codes: RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$ $1.php [NC,L] 回答1: Use only one of these, do not use together! Try: RewriteEngine