marm Posted June 21, 2007 Share Posted June 21, 2007 Hello, I'm trying to prevent malicious users from knowing that I am using a php.ini file in my site. I have placed these lines in .htaccess but when you fetch headers on that file, it returns a 302 error. How can I send a 404 error instead of 302 ? <Files ~ "\.(ini)$"> order allow,deny deny from all </Files> Quote Link to comment Share on other sites More sharing options...
marm Posted June 21, 2007 Author Share Posted June 21, 2007 I mean to say 403 NOT 302. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 22, 2007 Share Posted June 22, 2007 Using a php.ini file in your website? I dont fully understand. Can you not place the php.ini in a NON web accessible folder? Here are the apache error codes: http://wiki.kartbuilding.net/index.php/Apache#Apache_Error_Codes 403 means forbidden, which by your <Files> restriction code, seems correct. -steve Quote Link to comment Share on other sites More sharing options...
marm Posted June 23, 2007 Author Share Posted June 23, 2007 That's true for php.ini but what if I would like to do the same for .htaccess ? Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 25, 2007 Share Posted June 25, 2007 Apache prevents viewing of .htaccess files by default. -steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.