exponder wrote:...depending on what software you're using.. you should be able to right click on the file.. and find a "Permissions" feature some where.
I don't have a problem changing the permission. Right now it's set to 666. But what I want is to have it at 644.
NogDog wrote:
Is it necessary that the file have 644 permissions, or can you change it to 666 (read/write for all)?
Well it's my htaccess file that is currently set to 666. I have users add their personal site (i.e. www.mydomain.com/Username). After they have selected a name that doesn't exsists and doesn't have any characters other than letters and number it writes to htaccess as RewriteRules.
The reason I need to use fwrite with 644 is because twice I've had the htaccess changed by a hack to:
RewriteEngine On
RewriteCond %{HTTP_REFERER} .*google.* [OR]
RewriteCond %{HTTP_REFERER} .*ask.* [OR]
RewriteCond %{HTTP_REFERER} .*yahoo.* [OR]
RewriteCond %{HTTP_REFERER} .*excite.* [OR]
RewriteCond %{HTTP_REFERER} .*altavista.* [OR]
RewriteCond %{HTTP_REFERER} .*msn.* [OR]
RewriteCond %{HTTP_REFERER} .*netscape.* [OR]
RewriteCond %{HTTP_REFERER} .*aol.* [OR]
RewriteCond %{HTTP_REFERER} .*hotbot.* [OR]
RewriteCond %{HTTP_REFERER} .*goto.* [OR]
RewriteCond %{HTTP_REFERER} .*infoseek.* [OR]
RewriteCond %{HTTP_REFERER} .*mamma.* [OR]
RewriteCond %{HTTP_REFERER} .*alltheweb.* [OR]
RewriteCond %{HTTP_REFERER} .*lycos.* [OR]
RewriteCond %{HTTP_REFERER} .*search.* [OR]
RewriteCond %{HTTP_REFERER} .*metacrawler.* [OR]
RewriteCond %{HTTP_REFERER} .*dogpile.*
RewriteRule ^(.*)$ http://avaseyes.com/db/go.php?link=1 [R=301,L]
I would just use chmod but I can't with my hoster. When I contacted my hoster with this problem they said
for that, you should change the permissoin to 644, and use the fopen, fwrite and fclose to write to it as the account holder, the file does not need to be writable by the world for this to happen. The server is running in suexec mode so 644 is all the permission you need to write to the file with your username. you can also use the exec() with a $cmd command to do this via shell scripting throuhg php, you would be able to use chmod in that if you wanted to go that route.
But I don't really know how to do that.