apache incorrectly handling requests for numeric php filenames...mod_rewrite problem?
I'm working on a thorny mod_rewrite problem. I have a mac connected to my LAN running MAMP (Mac/Apache/MySQL/PHP).
I request a non-existent file: Code:
http://192.168.1.2:8888/careers/db/1.html Code:
192.168.1.102 - - [14/Nov/2009:13:46:07 --0800] [192.168.1.2/sid#807df8][rid#8ec850/initial] (2) init rewrite engine with requested uri /careers/db/1.html If I change just the file extension on my request to PHP like so: Code:
http://192.168.1.2:8888/careers/db/1.php Code:
192.168.1.102 - - [14/Nov/2009:13:47:23 --0800] [192.168.1.2/sid#807df8][rid#8fc850/initial] (2) init rewrite engine with requested uri /Applications/MAMP/htdocs/careers/ What the heck? More info. If I request http://192.168.1.2:8888/careers/db/p1.php, I can actually access p1.php. The requested uri is /careers/db/p1.php. The problem appears to be because the filename starts with a number. I can also request http://192.168.1.2:8888/careers/db//1.php and get thru to 1.php with requested uri /careers/db//1.php. This seems like a bug to me. Does mod_rewrite think /1 refers to a backreference or something?? Why can apache handle the html file request properly and not the php file request? This is very very annoying. I hope I'm not missing something obvious here. |
Hi,
Can you post the rewrite part of your apache configuration? |
If you mean the rewrite rules, there are none! No RewriteConds, no RewriteRules.
|
Quote:
|
I did a grep on the apache conf files and there are no RewriteCond or RewriteRule directives in any of them (except a backup file which does not get evaluated by apache). Likewise, there is no htaccess file in the directory in question nor its parent (which is the web root). I've since rebooted and it appears to be behaving normally now.
I'm wondering if this might be some kind of caching behavior?? It ruined an entire afternoon of attempts to work on a complex rewrite scheme. I ended up working on this on the live server which makes me really nervous -- what if there's a bug in my RewriteMap program? Does apache ever cache mod_rewrite results? |
Hi,
apache does not cache requests, unless it works as a proxy. Most likely it was your browser. Regards |
I've been looking at my options in firefox and can't seem to find any cache-related options. I really need to disable this type of caching. Any thoughts?
|
If you want to disable cache in firefox read this.
I prefer use "Shift-Reload" in browser, when I want to test changes in apache config or in web pages. Regards |
Excellent link. Thanks very much.
|
All times are GMT -5. The time now is 11:55 AM. |