I'm using Apache and I have a sample web folder on my Local Host, like:
http://localhost/test/
Files in the test
folder:
index.html
sample.jpg
.htaccess
Sample source of index.html
:
<html>
<body>
<img src="sample.jpg" />
</body>
</html>
When I run the website at http://localhost/test/
, it will simply show the image `sample.jpg' on the page.
Problem:
- I want to prevent the image showing as
http://localhost/test/sample.jpg
directly in the url bar.
Note: I found that the solutions below work when tested on every browser except Firefox.