%{REQUEST_FILENAME}和%{THE_REQUEST}返回了什么内容?
我只是检查我们的.htaccess文件,它突然出现在我身上,我对此知之甚少.下面的代码使用两者.它的工作原理我只想了解它.
#remove / at the end of URL
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/$ /$1 [L,R=301]
#remove /index.php at the end of URL
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)
干杯,马克
.htaccess ×1