我该怎么做这样的事情: website.com/store/ 重定向到 website.com/store website.com/outbound/store/5 重定向到 website.com/outbound/store/5/
我想要的是对于没有前缀的 url 来删除斜杠,对于那些有前缀的 URL 来添加斜杠
我的.htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^pa/?$ /admin/index.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ stores.php?store=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^outbound/([^/]*)/([^/]*)$ /outbound.php?type=$1&id=$2 [L]