Apache's Rewrite Condition not file (!-f) behaviour

偶尔善良 提交于 2019-12-10 12:11:20

问题


I have basic htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rewrite.php?data=$1 [L,QSA]

It works as expected for the most part. What doesn't work as I would like it to is this:

I have this link that doesn't rewrite as per the rule:

http://domain.com/movies.php

But also these url's are not rewritten either:

http://domain.com/movies http://domain.com/movies/ http://domain.com/movies/fdgdgdgdg

Is this normal behaviour? How can I fix this so that the only working url would end with movies.php


回答1:


I think this is a multiviews problem. Disable multiviews with

Options -MultiViews


来源:https://stackoverflow.com/questions/14131216/apaches-rewrite-condition-not-file-f-behaviour

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!