corbeeresearch Posted October 3, 2010 Share Posted October 3, 2010 Hi, I'm not sure where to start with mod_rewrite. I have a folder that contains a lot of php files that are link through href, for example <a href="tabs/current/tabs.php">click here</a> unfortunately, if they go to the url and type tabs/ instead, they will see all the files and download the php and view the source code, which would make my code vulnerable, so how do I avoid this and which part of mod_rewrite should I learn? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/215021-newbie-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 3, 2010 Share Posted October 3, 2010 and download the php Have you tested that anyone can actually do that? That would imply that you have either disabled the php language in a folder or the method that you used to enabled php in the first place is specific to some other folder. Quote Link to comment https://forums.phpfreaks.com/topic/215021-newbie-question/#findComment-1118468 Share on other sites More sharing options...
corbeeresearch Posted October 3, 2010 Author Share Posted October 3, 2010 Err...just tested it, and you're right, I can't see the source code. Quote Link to comment https://forums.phpfreaks.com/topic/215021-newbie-question/#findComment-1118469 Share on other sites More sharing options...
PFMaBiSmAd Posted October 3, 2010 Share Posted October 3, 2010 If you want to prevent the listing of files, when you don't have a default document file present, add the following to the .htaccess file in your document root folder - Options -Indexes Quote Link to comment https://forums.phpfreaks.com/topic/215021-newbie-question/#findComment-1118470 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.