在您的帮助下,我已经设法获得了这个 .htaccess,但我还需要 1 个带有扩展名的目录。例如:www.url.com/beheer/index.php,因此 /beheer 下的所有内容都必须带有扩展名。
这是当前的 .htaccess:
# remove trailing slash if not directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# remove index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\ /(.*)index\.php/?([^\?\ ]*)
RewriteRule ^ /%1%2 [L,R=301]
# remove php extension
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\ /(.*)\.php($|\ |\?)
RewriteRule ^ /%1 [L,R=301]
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]*)(\.php)?(\?*)$ index.php/$1$3 [L,QSA]