Ubuntu14.04下配置Apache伪静态

jerry apache 2015年08月26日 收藏

Ubuntu Apache 伪静态配置 url重写 步骤:
1.加载rewrite模块

  1. sudo ln -/etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

如图:

2015-08-26_124734.png

2.将您的主机的<Directory></Directory>中的AllowOverride None改为AllowOverride All

  1. <VirtualHost *:80>
  2.     ServerAdmin aa@163.com
  3.     DocumentRoot "D:/phpxm/yanshi/ys"
  4.     ServerName ys.com
  5.     <Directory "D:/phpxm/yanshi/ys"> 
  6.             AllowOverride All   
  7.             Order allow,deny   
  8.             Allow from all 
  9.             Require all granted
  10.     </Directory>
  11.     ErrorLog "D:/phpxm/yanshi/ys/error.log"
  12.     CustomLog "D:/phpxm/yanshi/ys/access.log" common
  13.  </VirtualHost>

3.重启apache2

  1. sudo service apache2 restart