H
H
hitakiri2016-03-01 19:35:50
symfony
hitakiri, 2016-03-01 19:35:50

How to serve static files in Symfony?

I ran into a problem:
in the web/ folder there is a static folder (there may also be subfolders) with static html pages.
How to tell Symfony to handle the view request is mysite.local/static/page1.htmlunnecessary?
Symfony - 3.0.3 Webserver - apache2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2016-03-01
@hitakiri

.htaccess has static file handling out of the box:

# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question