Jump to content

Recommended Posts

One of my scripts, i need to edit the htaccess file on creation of a new page and add a new line in

 

i am worried that if there is any timeouts or anything that causes the htaccess to part save, it will throw the whole site into a server 500 error.

 

Anyone have any suggestions for how to update a htaccess with minimal risk using a php script, and if somesort of failsafe can be put in?

 

Thanks in Advance....

Link to comment
https://forums.phpfreaks.com/topic/136209-risk-free-htaccess-editing-with-php/
Share on other sites

Does the site timeout alot?

 

I do not think the timeout happens a ton, and if it does they just have to go in through ftp and remove the bad .htaccess. Which in essentially means I do not think there is a fail safe way.

 

You could however create the file as a temp file such as htaccess.temp, then if it wrote correctly do a rename from htaccess.temp to .htaccess

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.