Ubuntu Apache 伪静态配置 url重写 步骤:
1.加载rewrite模块
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
如图:
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