我跟踪.htaccess文件:
RewriteEngine On
RewriteBase /
RewriteRule ^plugins/.* pluginLoader.php [L]
RewriteRule ^settings\.php index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} \.art$ [OR]
RewriteCond %{REQUEST_FILENAME} /system/
RewriteRule .* index.php [L]它是如何工作的,直到URL指向位于plugins目录中没有扩展名的现有文件名为止。我也不知道原因。例如,有一个/plugins/invoice/name.txt文件。
http://localhost/plugins/invoice/name.txt
uses pluginLoader.php as expected
http://localhost/plugins/invoice/name.
uses pluginLoader.php as expected
http://localhost/plugins/invoice/name
uses index.php! Why?
http://localhost/plugins/invoice/nam
uses pluginLoader.php as expected对于所有具有.txt或.php扩展名的文件也是如此。如果文件具有.sql扩展名,它既不使用pluginLoader.php也不使用index.php。它发送404 -没有找到。
有预处理器吗?
有趣的是:
RewriteEngine On
RewriteBase /
RewriteRule ^plugins/.* pluginLoader.php [L]
RewriteRule ^settings\.php index.php [L]删除最后四行使其正常工作。但是URL http://localhost/plugins/invoice/fill仍然得到一个404错误。当文件被重命名时,URL可以工作。
神秘..。
发布于 2012-05-30 16:49:10
将.htaccess代码替换为下面的代码,看看这是否有帮助:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^plugins/ pluginLoader.php [L,NC]
RewriteRule ^settings\.php/?$ index.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} \.art$ [OR]
RewriteCond %{REQUEST_FILENAME} /system/
RewriteRule ^ index.php [L]确保在.htaccess目录中没有$DOCUMENT_ROOT/plugins。
https://stackoverflow.com/questions/10812474
复制相似问题