Portal Home > Knowledgebase > Articles Database > Very weird Apache(?) problem / serving xxx.php if I request /xxx/


Very weird Apache(?) problem / serving xxx.php if I request /xxx/




Posted by ovisopa, 03-04-2010, 08:18 PM
Hello guys, I'm having a very weird problem, some guy contacted me if I can fix his website, he bought an online shop, and after more than a year, now a week ago some pages did not opened anymore. I have investigate it and after many hours I found this: If I make a request like www.site.com/test/ and I have in root a file test.php, I will get the test.php file instead of a 404 error. This website uses a 184 lines .htaccess file but I delelted it from the server and still the same issue. If I delete the php file i will get an 404 error, if I write a rule in the htaccess file like RewriteRule ^test/file.html testOK.php and if the file test.php is in the root I will still the test.php file instead of the one I specified in the the rule. If I delete the test.php file and access the link www.site.com/test/file.html everything is fine. Anyone had any similar problem ? I have contacted this guy's hosting company because to me it seems an apache problem. PS. I have checked cPanel error pages and all pages are empty, so there's no script processed when a 404 error should popup. I have checked the access log and I can see the link I have accessed with 200 status code.

Posted by FrankLaszlo, 03-04-2010, 09:11 PM
Is there a parent .htaccess file that it could be reading from? cPanel servers will read a heirarchy of .htaccess files starting from the users home directory. so I would check for the existance of /home/user/.htaccess /home/user/public_html/.htaccess /home/user/public_html/addondomain.com/.htaccess etc

Posted by ovisopa, 03-05-2010, 03:49 AM
there is no other .htaccess file in /home/user

Posted by ovisopa, 03-09-2010, 05:50 PM
After investigating alot, I have asked hosting company to enable rewritelog, I needed to asked them in 3 different emails because they keep pointing the finger to the way the website was coded, and telling me it's a problem on that website .. anyway , after they enabled the RewriteLog I see for every request in the log was I could see something like this : It seemed the server somehow matched all the files with some rules .. very weird. Anyway, I explained them once again that there can't be any problem with the website, because at the moment when RewriteLog was enabled I used only a single rule in the htaccess (test1/blabla.html > test1ok.html) and the match wasnt correct. They told the website owner they can move his website on another server, because they can't find the problem ... they moved it and the website worked without any issue, so it was something about the server.. but no one knows what.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
SaaS (Views: 601)