Skip to content

Commit d20b8c1

Browse files
committed
fix: url rewrite for php extension
1 parent e30a4ff commit d20b8c1

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
FROM php:8.2-apache
22

3+
# Enable mod_rewrite
4+
RUN a2enmod rewrite \
5+
&& echo '<VirtualHost *:80>\n\
6+
DocumentRoot /var/www/html\n\
7+
<Directory /var/www/html>\n\
8+
Options Indexes FollowSymLinks\n\
9+
AllowOverride None\n\
10+
Require all granted\n\
11+
RewriteEngine On\n\
12+
RewriteCond %{REQUEST_FILENAME} !-d\n\
13+
RewriteCond %{REQUEST_FILENAME} !-f\n\
14+
RewriteCond %{REQUEST_FILENAME}.php -f\n\
15+
RewriteRule ^(.+)$ $1.php [L]\n\
16+
</Directory>\n\
17+
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
18+
319
COPY . /var/www/html/
420
RUN chown -R www-data:www-data /var/www/html
521
EXPOSE 80

0 commit comments

Comments
 (0)