Can I make a dynamic .htaccess file?

后端 未结 3 2118
自闭症患者
自闭症患者 2020-12-30 17:14

Can I make my .htaccess be generated with php?
I would like to use php to dynamicly create my htaccess file from information from the database.
It would save me the

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 17:41

    You definitely can generate your .htaccess with PHP if you had a backend script to do it - say in your admin area. But it seems risky and potentially unnecessary? if something goes wrong, your site will be down until you fix it - that potentially means the page you're using to generate it. Why not just create an interface that generates the new rules for you from a database, then you can have a quick look over and copy them in?

    What exactly is it that you're trying to update?

提交回复
热议问题