今天就跟大家聊聊有關(guān)怎么在php中對apache mod_rewrite模塊進(jìn)行檢測,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
具體實(shí)現(xiàn)方法如下:
function isRewriteMod() { if (function_exists('apache_get_modules')) { $aMods = apache_get_modules(); $bIsRewrite = in_array('mod_rewrite', $aMods); } else { $bIsRewrite = (strtolower(getenv('HTTP_MOD_REWRITE')) == 'on'); } return $bIsRewrite; }
使用方法:
if (!isRewriteMod()) exit('Please install Apache mod_rewrite module.');
看完上述內(nèi)容,你們對怎么在php中對apache mod_rewrite模塊進(jìn)行檢測有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。