我試圖刪除.PHP .html和使用htaccess的URL從斜線traling,怎麼過這個代碼工作正常,爲PHP而不是HTML和斜線htaccess的刪除.PHP,.html和斜線
對於PHP
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
對於HTML
RewriteCond %{REQUEST_URI} index.html
RewriteRule ^(.*)index.html$ /$1/ [R=301,L]
RedirectMatch 301 ^(。*)/ $/$ 1正在爲我的尾部斜槓 – Vishal