我在我的 .htaccess 文件中禁用了目录浏览,最近我更改了我的默认索引页面,它可以工作。但是现在当我浏览到:domain.com/images/时,它应该给我一个 403 禁止错误,但它只是转到索引页面' /en/index.php '本身。
#Turn rewrite engine on
RewriteEngine on
#Disable directory browsing
Options -Indexes
#Default index page
DirectoryIndex /en/index.php
ErrorDocument 404 /error.php
#Add trailing slash
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*) /$1/ [R=301,L]
#Remove trailing slash
RewriteCond %{REQUEST_URI} !^/en/$
RewriteCond %{REQUEST_URI} !^/fr/$
RewriteCond %{REQUEST_URI} !^/images/$
RewriteCond %{REQUEST_URI} !^/includes/$
RewriteCond %{REQUEST_URI} !^/stylesheets/$
RewriteRule ^/$ /$1 [R=301,L]
#Redirect non-www to www
RewriteCond %{HTTP_HOST} \.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
#Add trailing slash
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*) /$1/ [R=301,L]
#English
RewriteRule ^what-is-minecraft/$ /en/what-is-minecraft.php [NC,L]
RewriteRule ^getting-started/$ /en/getting-started.php [NC,L]
RewriteRule ^mods/$ /en/mods.php [NC,L]
RewriteRule ^best-mods/$ /en/best-mods.php [NC,L]
RewriteRule ^terms-of-service/$ terms-of-service.php [NC,L]
RewriteRule ^privacy-policy/$ privacy-policy.php [NC,L]
#French
RewriteRule ^fr/cest-quoi-minecraft/$ /fr/cest-quoi-minecraft.php [NC,L]
RewriteRule ^fr/demarrage/$ /fr/demarrage.php [NC,L]
RewriteRule ^fr/mods/$ /fr/mods.php [NC,L]
RewriteRule ^fr/meilleurs-mods/$ /fr/meilleurs-mods.php [NC,L]
RewriteRule ^fr/$ /fr/index.php [NC,L]
任何人都可以找出问题所在吗?
编辑:发布我完整的 .htaccess 代码。