Tag: url rewriting

angularjs url重写不工作在运行apache2的docker容器

我正在尝试做一个angularJS应用程序在Docker容器上运行apache2(启用html5模式)的URL重写, Dockerfile: FROM httpd:2.4 RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /usr/local/apache2/conf/httpd.conf COPY ./dist/ /usr/local/apache2/htdocs/ .htaccess文件位于index.html旁边的dist文件夹中 .htaccess文件: RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ – [L] # If the requested resource doesn't exist, use index.html […]