Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache docker container - .htaccess rewrite rule 404

I have a rewrite rule in my .htaccess like so: RewriteRule ^ /var/www/index.html [L] (for an angular app's view routing)

However, when I go to /anything I get 404. Any idea why this would be? Base docker container is eboraas/apache.

My dockerfile:

FROM eboraas/apache

RUN a2enmod rewrite

ADD . /var/www

EXPOSE 80

Edit: also tried rule ^.*$ with no luck. it appears to be that .htaccess is not being used/is being ignored, not that the rule is wrongly configured.

like image 278
jtmarmon Avatar asked Apr 09 '15 15:04

jtmarmon


1 Answers

In my case AllowOverride All was already in place for the whole /var/www directory, I just only had to add this into Dockerfile:

# enabling mod_rewrite
RUN cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
like image 52
Dmitriy Avatar answered Sep 18 '22 12:09

Dmitriy