Ubuntu14.04下配置Apache伪静态

jerry apache 2015年08月26日 收藏

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

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

如图:

2015-08-26_124734.png

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

<VirtualHost *:80>
    ServerAdmin aa@163.com
    DocumentRoot "D:/phpxm/yanshi/ys"
    ServerName ys.com
    <Directory "D:/phpxm/yanshi/ys"> 
            AllowOverride All   
            Order allow,deny   
            Allow from all 
            Require all granted
    </Directory>
    ErrorLog "D:/phpxm/yanshi/ys/error.log"
    CustomLog "D:/phpxm/yanshi/ys/access.log" common
 </VirtualHost>

3.重启apache2

sudo service apache2 restart