DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Linux Servers and Apache (http://www.daniweb.com/forums/forum33.html)
-   -   how to htaccess root directory to return 404 (http://www.daniweb.com/forums/thread194213.html)

jakesee May 27th, 2009 8:53 am
how to htaccess root directory to return 404
 
Hi,

Seen many tutorials teaching how to make 404 redirect to an existing page or do a custom 404 page.

How can I do the converse i.e. any file access in the root directory will return a 404?

for example the following files exist, but I want to display 404 error:
http://www.example.com
http://www.example.com/anyfile.html

but these will not cause 404:
http://www.example.com/subfolder
http://subfolder.example.com/
http://www.example.com/subfolder/otherfile.html

My objective is to temporarily disable access to my main website hosted on APACHE + CPANEL, but still allow access to add on domains and subdomains, both manifested as subfolders in the root directory, and use 404 error as a cover.

Thanks for replies.

Jake


All times are GMT -4. The time now is 8:46 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC