homepage Welcome to WebmasterWorld Guest from 54.204.73.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP and .htaccess
Editing .htaccess with a PHP script
Scooter24

10+ Year Member



 
Msg#: 1169 posted 8:30 pm on Sep 8, 2002 (gmt 0)

I'd like to write a small php application which if called edits the .htaccess file. From what I understand I would have to set the permissions of .htaccess to 666 (from 644 as they are now). Having a .htaccess file with permissions set to 666 compromises the security, doesn't it ?

Is there a way with PHP to change the permissions of .htaccess temporarily to 666, make the changes and then set back .htaccess to 644 ?

 

Nick_W

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1169 posted 8:44 pm on Sep 8, 2002 (gmt 0)

[php.net ]

Though I'm not sure if you can change it if the permissions deny access to start with?

Nick

Key_Master

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1169 posted 9:13 pm on Sep 8, 2002 (gmt 0)

You shouldn't need to change the permissions of .htaccess to edit it. The script you use to edit the .htaccess file will have the authority to make the changes. You should be more concerned about securing the editing script.

Scooter24

10+ Year Member



 
Msg#: 1169 posted 9:54 pm on Sep 8, 2002 (gmt 0)

It should, but I tried another script (which edited a textfile) and even a 664 wasn't sufficient. I had to set the permissions to 666 so that the PHP script could make changes.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved