Forum Moderators: phranque

Message Too Old, No Replies

Strange problem resolving paths (affecting mod rewrite)

         

richcon

8:05 pm on Sep 8, 2009 (gmt 0)

10+ Year Member



If the following file exists:

/app/foo/bar.jpg

and the user goes to the URL:


/app/foo/bar/

The 404 Not Found page that results shows:


Not Found
The requested URL /app/foo/bar.jpg/ was not found on this server.

This is effecting my app, because I have an mod_rewrite rule in my .htaccess file that launches a web app if the given filename doesn't exist. But in the above case the rule breaks down and the app never launches, as if mod_rewrite thinks the path exists when it doesn't. Instead I get the above 404 Not Found page. (Following is the mod_rewrite code:)


RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* (Launch my web app)

This problem only happens if the existing file's extension is of a filetype Apache knows. It doesn't happen if the file is renamed from bar.jpg to bar.#*$!.

Any ideas what's going on here?

jdMorgan

4:11 am on Sep 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Disable content-negotiation if you don't use it, by using

Options -MultiViews

Jim

richcon

5:02 am on Sep 9, 2009 (gmt 0)

10+ Year Member



That did it, thanks!