douchujian8124 2017-01-04 10:47 采纳率: 100%
浏览 28

停用Apache Rewrite for Folder

I have an Apache web server with default settings, I didn't add any rewrite rules to it.

When I request a file through my application, if the file doesn't exist then Apache returns another file with a close name to the original name. The GET return is 301. I don't want this behavior but I am not sure how to disable it.

I attempted several solutions I found online, but none seem to work. Here are my attempts:

  • I added a .htaccess file with a RewriteEngine Off
  • I added a .htaccess file with a RewriteEngine On but without any other lines or rules for the rewrite. One person online suggested that this is similar to turning it off.
  • I added a <Directory> directive in httpd.conf, with only one line in it: RewriteEngine Off. I attempted the Directory two times, one time with a full path, and another time with a path starting after the domain name. For example, the link is www.domain.com/some/path/file.flv. My first attempt was <Directory "/root/to/some/path/"> and the second attempt was <Directory "/some/path/">.

None of these attempts have worked and I am not sure how to resolve this issue.

UPDATE 1:

My application is a Flex Application created with the Flex SDK. I have Adobe Media Server installed on my server. My application loads a video file by setting the source property of the VideoDisplay object to (for example): "/some/path/123_video.flv".

Now if that file doesn't exist, and I have a file called: "124_video.flv" then this other file will be played instead and my /var/log/httpd/access_log will have a line with GET 301 return value.

I am sure that I send the correct file name from my application. The access_log even shows my file's name (123_video.flv in this example) but with a 301 return code and then my application plays the other video (124_video.flv).

As a test, I disabled the mod_rewrite.so module in my httpd.conf (by commenting the line with #) and I started getting 500 as a return code for files that didn't exist.

What is more strange, I just did a quick test again, I went through my httpd.conf and changed all AllowOverride All to AllowOverride None restarted the httpd server and I still got the 301 code!!

I even commented the mod_rewrite.so again and restarted the server.. and I got the same result 301!!

I think my last test has something else wrong in it, but not sure what.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 目详情-五一模拟赛详情页
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line