Jump to content

Risk free .htaccess editing with php


elgoog

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.