ubuntu apache默认没开启rewrite 如何开启

注意看到 /etc/apache2/apache2.conf

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

然后发现 avaliable 里面有 rewrite  但是 enable里面没有 于是就需要开启一下 然后一个命令就好了

$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2

之后执行一下 这个

sudo systemctl restart apache2

然后看一下 mods-enabled 里面有rewrite了 

这样那些页面访问 就可以拿掉 index.php了

posted @ 2021-04-09 21:58  李照耀  阅读(147)  评论(0编辑  收藏  举报