How does php modify the. htaccess file?

Source: Internet
Author: User
How to modify the. htaccess file in php is as follows. Modify the. htaccess file on the php page. Insert, delete, and other operations. The method for opening a file found on the Internet does not seem to be applicable to this file. Thank you for your patience ~ Thank you ~, Fopen and fwrite functions are used to open or create files. Fwrite is mainly used to write what you want to write .. Php: how to modify the. htaccess file
As the question.
Modify the. htaccess file on the php page. Insert, delete, and other operations.
The method for opening a file found on the Internet does not seem to be applicable to this file. Thank you for your patience ~
Thank you ~

------ Solution --------------------
Use fopen and fwrite functions
Fopen is mainly used to open or create files.
Fwrite is mainly used to write what you want to write ..

------ Solution --------------------
Use fopen fwrite ~~~

Open fopen

Fwrite write
------ Solution --------------------
The read and write operations are the same as those in the. txt file. Come on, you can.
------ Solution --------------------
. Htaccess files are generally read-only. it is not recommended to set them to writable (for your security concerns ).
If you must do this, check the read and write permissions of. htaccess.
------ Solution --------------------
$ Fp = fopen ('. htaccess', 'A ');???
How can you modify the file opened in append mode?

Yes
$ Fp = fopen ('. htaccess', 'R + ');
Only

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.