I am looking into more security for my site and someone told me to modify my .htaccess file to only let PHP scripts access my page. I contacted my hosting provider and they said I would have to switch to a Linux server. Is this a good idea? Like what benefits does a Windows server have that Linux doesn't or is Linux just better? And is there anyway I could make it so only my PHP scripts can write files to my server? Thanks! ~imozeb
I only use linux servers. if you are creating php, there is no reason to stay in a windows server. not sure why your hosting provider told you that you NEED to switch to linux, really doesnt make a difference, unless im missing something.
My hosting provider only provides .htaccess support if I am using Linux servers. But I was wondering if Windows had any advantages because, why have them if their so useless?
If your developing in asp.net (or another microsoft language) then you would want windows. Other then that, there is really no reason to choose a windows server.
Only reason to use windows is if you are developing on something proprietory; even then there are often ways to achieve the same thing on linux. You are far better off using a linux server, if not for reliability then speed.
Is there anyway I can modify my htaccess file so only my PHP scripts can write to my sites folders. Or are there any pieces of code that I should put in my htaccess file that would make my site more secure?
Apart from all the reasons discussed here why you should prefer using linux servers I've also noticed that sometimes the hosting packages for linux are cheaper than those of windows.
In honesty, I prefer linux servers. You'll find that if you're running PHP, then running windows is a more expensive option, since microsoft hosting will grant you the ability to run ASP, which you've said you don't use. Since you're not managing your own servers, then it won't matter on the complexity of maintaining the OS on the server, so it may be worth a look into the linux options instead, just make sure you're prepared for any server migration if you change hosts