Add mod_rewrite to Docker image httpd:alpine

≡放荡痞女 提交于 2019-12-04 18:06:28

mod_rewrite is installed by default with apache in alpine, so no need to install it again. So here's how you enable mod_rewrite in Alpine:

FROM httpd:alpine

# Copy .htaccess into DocumentRoot
COPY ./.htaccess /var/www/html/

RUN sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf

RUN { \
  echo 'IncludeOptional conf.d/*.conf'; \
} >> /usr/local/apache2/conf/httpd.conf \
  && mkdir /usr/local/apache2/conf.d
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!