Apache的重写条件不是文件(!-f)行为 [英] Apache's Rewrite Condition not file (!-f) behaviour

查看:51
本文介绍了Apache的重写条件不是文件(!-f)行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有基本的htaccess文件:

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

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

这是正常行为吗?我该如何解决这个问题,以便唯一的工作URL以movies.php结尾

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

推荐答案

我认为这是一个多视图问题.使用

I think this is a multiviews problem. Disable multiviews with

Options -MultiViews

这篇关于Apache的重写条件不是文件(!-f)行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆