0

I want to create http://localhost/Symfony/temp/.

In temp will be a basic index.html and some images. If I create the folder right now and put the index.html file in /temp/ I get a 404.

How do I get a normal response from http://localhost/Symfony/temp/index.html?

2 Answers 2

1

Requests going to temp/ are being caught by Symfony's default .htaccess. You'll have to add following:

# allow access to temp
RewriteRule ^temp.* - [QSA,L]

If you want it to work even with app_dev.php just change it to ^[app_dev.php/]*temp.*.

But I'm more interested why do you want to do that in root directory and not in static files directory (eg. web/static/temp). You wouldn't need to mess around with .htaccess and you'd be able to link to such images with asset(...).

Sign up to request clarification or add additional context in comments.

1 Comment

Because I'm a total Symfony n00b. I did figure out the solution I was looking for, but yours is more graceful. Thank you. I'll post my version for posterity.
0

Here's the solution I eventually came up with.

All I did was create a .htaccess file in /temp/ and inserted:

allow from all

Since I was getting a 404 error and all the other symfony folders had a .htaccess with

deny from all

I reversed engineered an answer.

Hope this helps someone else.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.