I want to write a wordpress plugin that requires changing the .htaccess file. How do I do that in PHP. I have seen this done before with other plugins but, I can not figure out how it is done. Thanks!
1 comment
Comments are closed.
I want to write a wordpress plugin that requires changing the .htaccess file. How do I do that in PHP. I have seen this done before with other plugins but, I can not figure out how it is done. Thanks!
Comments are closed.
The function in wordpress to update the
.htaccess
file isinsert_with_markers
it takes three parameters.in following this tutorial you could write something like this
That would look like this in the your
.htaccess
fileHere is a link to wordpress’ documentation of that function
https://developer.wordpress.org/reference/functions/insert_with_markers/