0

I am having a problem with Apache. What it does is this: Take /index.php file containing an code with src set to relative path myimg.jpg, both in the root of my server. So, www.mysite.com would show the image as would www.mysite.com/index.php.

However, if I access www.mysite.com/index.php/ (with a trailing slash) it does the odd thing of executing index.php code as it would be inside an index.php folder (e.g. /index.php/index.php), thus not showing the image anymore.

This is a simple example that's easy to solve with absolte addressing etc, the problem I am getting from this a security one that's not so easily fixed.

So, how can I get Apache to give a 403 or 404 when files are accessed "as folders"?

Thank you.

1 Answer 1

1

"AcceptPathInfo off" would prevent Apache from mapping a request to /index.php/ to index.php + PATH_INFO of "/".

2

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.