openSUSE中启用apache mod_rewrite
生活随笔
收集整理的这篇文章主要介绍了
openSUSE中启用apache mod_rewrite
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
1. 编辑 "/etc/sysconfig/apache2"文件
查找 APACHE_MODULES,你应该会找到一行像
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout authn_core php7 php5 version"2. 添加 "rewrite"在这行的""中,
如:
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout authn_core php7 php5 version rewrite"3. 运行 sudo systemctl restart apache2 重启apache2
现在 apache2 rewrite已经启用了。
4.使用你喜欢的编辑器编辑 /etc/apache2/default-server.conf 文件
5. 查找 AllowOverride -- 这应该在 <Directory "/srv/www/htdocs"> 下面
6. 将 AllowOverride None 修改为 AllowOverride All
7. 保存文件修改并退出
8. 运行 sudo systemctl restart apache2 重启apache2
可以在 /srv/www/htdocs 中一个 info.php文件,使用你喜欢的编辑器写入以下内容:
<?php phpinfo(); ?>保存文件修改并退出,使用浏览器浏览 如:http://localhost/info.php , 查找 rewrite ,你应该就能找到它在页面中,说明rewrite启用了。
参考链接:
转载于:https://www.cnblogs.com/fsong/p/6759686.html
总结
以上是生活随笔为你收集整理的openSUSE中启用apache mod_rewrite的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 代理模式【介绍、静态代理、动态代理、入门
- 下一篇: echo指令