Php mod_重写添加尾部斜杠

Php mod_重写添加尾部斜杠,php,linux,apache,mod-rewrite,Php,Linux,Apache,Mod Rewrite,我有很多URL,比如domain.com/something/完整的工作解决方案,我最终发现这是一个操作顺序 RewriteEngine On RewriteOptions inherit RewriteBase / RewriteRule ^index\.php$ - [L] **RewriteRule ^(.+?)/$ $1 [R=301,L] // this part first strips the trailing slash** RewriteCond %{REQUEST_FI

我有很多URL,比如domain.com/something/完整的工作解决方案,我最终发现这是一个操作顺序

RewriteEngine On
RewriteOptions inherit

RewriteBase /
RewriteRule ^index\.php$ - [L]

**RewriteRule ^(.+?)/$ $1 [R=301,L] // this part first strips the trailing slash**

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /membersite.php [L] //this part handles internally which file i'm loading from the server to process the request.
有帮助吗?请注意,在该节点中,他如何使用/?,您可能需要一些没有/
RewriteEngine On
RewriteOptions inherit

RewriteBase /
RewriteRule ^index\.php$ - [L]

**RewriteRule ^(.+?)/$ $1 [R=301,L] // this part first strips the trailing slash**

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /membersite.php [L] //this part handles internally which file i'm loading from the server to process the request.