我的htaccess文件有点小问题。目前,它将所有内容重定向回index.php进行处理,除非有人试图访问实际目录。当目录存在时,它将显示403错误页,而不是像预期的那样将路径重写为index.php。当通过Internet访问文件时,我可以修改什么使其始终转到index.php,但仍然在服务器上用php加载正确的文件?
Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteBase /
ErrorDocument 403 /index.php?403
ErrorDocument 404 /index.php?404
ErrorDocument 414 /index.php?414
RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule !^(.*) index.php [L]
示例文件结构:
Web Directory
- com
- source
- index.php
- TEST.HTML
“com”和“source”等文件夹将显示403,因为用户无权访问它们。“index.php”和“test.html”等文件执行正常。我希望我的htaccess重定向
一切
在web目录文件夹中返回index.php文件,无论什么。