How to block a user in apache httpd server from accessing a *.php file inside a Directory, instead user should access this using Directory name
Posted
by
Oxi
on Server Fault
See other posts from Server Fault
or by Oxi
Published on 2012-11-20T11:55:15Z
Indexed on
2012/11/21
11:06 UTC
Read the original article
Hit count: 284
My requirement looks Simple, But Googling Did not help me yet.
my query is
i want to Throw a 404 page to a user(Not Re-Direct to another folder or file),
who is trying to Access *.php files in my website
ex: when a client asks for www.example.com/home/ i want to show the content , but when user says
www.example.com/home/index.php i want to show a 404 page.
i tried different methods, nothing worked for me, one of which tried is shown below
<Directory "C:/xampp/htdocs/*">
<FilesMatch "^\.php">
Order Deny,Allow
Deny from all
ErrorDocument 403 /test/404/
ErrorDocument 404 /test/404/
</FilesMatch>
</Directory>
Thanks in Advance
© Server Fault or respective owner