Ninjakreborn Posted December 27, 2006 Share Posted December 27, 2006 I was wondering about something.I have recently started using htaccess a lot more than I ever thought i would, just for smaller things even. I have started password protecting temporary things using htaccess, if it's anything permanent I normally use other types of authentification to make sure they need access to that folder. For now, I was wondering, if I password protect specific pages will that allow the browser to get those pages.For instance, I just recently installed php my admin, on a raggidy server configuration (I hate his webhost but he wanted to stick with it)Now I am wondering, right now I password protected it, obviously it worked. What if I decided to password protect other stuff, like if I wanted to entirely keep people from going into my framework, if I htaccess it, then anytime someone goes to /master folder or any sub-folder of that, it will prompt for username and password, keeping people from snooping through my directory. What I was wondering, is, will it hurt anything. I mean, if I password protect/masterthen all my other directories will be too (css, and includes, and processors, and images)I am just wondering will that be bad.Even then, if i just password protected the config folder inside it, would that allow the pages to get to my include, even though the directory was password protected.I want to prevent people from messing with those folders??? Quote Link to comment https://forums.phpfreaks.com/topic/31956-htaccess/ Share on other sites More sharing options...
Ninjakreborn Posted December 27, 2006 Author Share Posted December 27, 2006 [quote]Turn directory listings on or offNormally when you navigate to a directory or folder on this web server, the files in that directory will not display because directory listings are turned off by default. If you do not have a file named index.html or other acceptable home page name, you will get an error that indicates you do not have permission to view that directory. However, if your site was migrated to this server from another EasyStreet server, we may have enabled directory listings since they were allowed in the previous environment.Turn directory listings on 1. Create a plain text file named .htaccess with the following line or add to an existing .htaccess file: Options +Indexes 2. Upload this .htaccess file to your / directory. This is the level above public. Note: If you already have a file named .htaccess there, simply add the above lines to that file rather than replacing it.Turn directory listings off 1. At the top level of your site, /, find the file named .htaccess and remove the line which reads: Options +Indexes 2. Upload this modified .htaccess file to your / directory. This returns your site to the default behavior, which has directory listings turned off.[/quote]Actually I think this was what I was wanting. This is one thing I was going to start using, this might help, what about other things. Like the passwording.This is my idea, I was going to build an htaccess file into the /master folder of my framework. This would allow me to actually have it always password protected on servers that worked with htaccess.Then I could have another htaccess file, I move to the upper level, that cuts off magic quotes, and some other things I prefer having set specifically. As well as the directive for it to stop showing the directory, that is what annoys me, are these going to be good ideas, or could any of this cause problems later? Quote Link to comment https://forums.phpfreaks.com/topic/31956-htaccess/#findComment-148273 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.