未指定输入文件-LAMP(Apache)



任何人都可以帮助我的htaccess文件,它只适用于根域目录文件夹,如果我将索引文件放入根域目录并访问这样的页面https://example.com/edr/login,效果很好。然而,当我在里面创建文件夹并尝试访问这样的网站时,https://example.com/createdfolder/edr/login,上面写着"不存在输入文件"。下面是我的htaccess文件代码。我的$_SERVER['QUERY_STRING']设置为'login'

Options All -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^(.*)$ $1.php [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]

如果要复制WordPress的.htaccess,它看起来像这样:

RewriteEngine On
RewriteBase /createfolder/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /createfolder/index.php [L]

当然,你可以用your/path/代替createfolder/

最新更新