debian版本apache开启伪静态功能

chen'mo
2018-07-22 / 0 评论 / 895 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于1970年01月01日,已超过19836天没有更新,若内容或图片失效,请留言反馈。

使用apt-get安装的apache情况:


文件及目录                             作用

/etc/apache2/apache2.conf      apache主配置文件

/etc/apache2/mods-available    可用模块目录

/etc/apache2/mods-enabled     有效模块目录(apache启动加载)

/etc/apache2/sites-enabled      有效host配置文件


启用伪静态功能

加载模块



ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load



设置host允许重写



vi /etc/apache2/sites-enabled/000-default

   <Directory /home/data/wordpress>

       Options FollowSymLinks MultiViews

       AllowOverride all

       Order allow,deny

       allow from all

   </Directory>


将AllowOverride这一个配置项修改为all,默认为None



编写重写规则


回到网站主目录,编辑.htaccess文件,


具体规则根据实际应用情况设置。



重启apache



/etc/init.d/apache restart

0
wordpress 用sqlite数据库全新安装
« 上一篇 07-22
ssmgr安装记 tssz.ml免费55R
下一篇 » 07-22

评论 (0)

插入图片