我有以下的htaccess:htaccess的URL重写规则与文件夹名称
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^models$ index.php [L]
RewriteRule ^post$ index.php?action=post [L]
和一个名为models
文件夹。
问题是:Apache将我发送到文件夹中。由于没有名为post的文件夹,因此使用“发布”重定向规则起作用。
编辑:
我忘了告诉大家,有htaccess的在模型文件夹也有:
Deny from all
因此,您希望'http://example.com/models'将其重写为'index.php',而不是'http:// example.com/models /'? – 2012-03-09 18:56:18
是的,我试过RewriteCond%{REQUEST_FILENAME} -d RewriteRule(。*)index.php [L] – pinkvoid 2012-03-09 19:05:00
如果您不使用它们,请关闭Multiviews和DirectoryIndex。 – TerryE 2012-03-10 06:11:13