I’d like to deny everything; except the following should be allowed:
1 http://example.com/
2 http://example.com/favicon.ico
3 http://example.com/downloads/secret/test.txt
via
RewriteEngine On
RewriteRule !^(favicon\.ico|downloads/secret/[^/]+\.[a-z]+)?$ - [F,L]
Number 2 and 3 work just fine. But I can’t reach http://example.com/
How do I modifiy my RewriteRule to make the first example work as well?
Add this:
change
index.phpto what ever index file you are using (likeindex.html,index.pletc)