dshp9580656 2018-06-11 21:59
浏览 129

如何启用Mod_Rewrite

Currently, I am running CentOS 7 with php 7. For the life of me, I can't get mod_rewrite working.

I am testing by using this code

if (function_exists("apache_get_modules")) {
$modules = apache_get_modules();
$mod_rewrite = in_array("mod_rewrite",$modules);
if($mod_rewrite)
{
    $result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> mod_rewrite is enabled</span>';
    $score++;
}
else
    $result[] = '<span class="label label-warning"><i class="icon-remove icon-white"></i> mod_rewrite is not enabled</span>';
}
else
    $result[] = '<span class="label label-warning"><i class="icon-remove icon-white"></i> mod_rewrite is not enabled</span>';

And it show "Mod_Rewrite is not enabled"

Eventhough I have added AllowOverride All to my Virtual Host in httpd.conf file

 <Directory "/home/mailingmm/public_html">
AllowOverride All
SSILegacyExprParser On
    </Directory>

Could you show me how to enable mod_rewrite? and how to test if mod_rewrite is on?

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab求解平差
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办
    • ¥15 vue2登录调用后端接口如何实现
    • ¥65 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?