943,741 Members | Top Members by Rank

May 27th, 2009
0

how to htaccess root directory to return 404

Expand Post »
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
Similar Threads
Reputation Points: 21
Solved Threads: 5
Junior Poster
jakesee is offline Offline
130 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: mod_rewrite subdomains
Next Thread in Linux Servers and Apache Forum Timeline: Debian 5.0 XFCE At A Glance





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC