我正在寻找帮助,使我的.htaccess文件指向我的index.php文件的所有请求,无论文件是否存在。目前,所有请求都发送到index.php,除非该目录中已存在该文件,我不想要,也不安全。
这是我目前的.htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
如果您有任何指针或资源,请告诉我。谢谢
答案 0 :(得分:1)
试试这个
{{1}}
答案 1 :(得分:1)
您可以使用:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.+)$ index.php?path=$1 [L,QSA]
如果您需要path
参数