Check AllowOverride value using PHP?

后端 未结 3 1637
萌比男神i
萌比男神i 2021-01-04 12:47

Is there anyway to use PHP to check the value of AllowOverride too see if .htaccess will have any effect?

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-04 13:24

    Easiest way

    Add: show-error in the first line on your page an load domain via browser to trigger a 50x error

    Another method that is terrible but guaranteed to work independently from specific Apache modules is to programmatically write gibberish into the .htaccess file, then to make a curl request like above, and to check for a 500 status code. If it throws a 500, the .htaccess file got interpreted. But as said, this is terrible - if possible, go with the headers method instead.

提交回复
热议问题