Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Everything I find seems to be about created a custom 404 page.

That is not what I am trying to do.

If I want to block access to a page I can do this in htaccess:

RewriteRule pattern - [F]

However, "Forbidden" hints that the page does exists. I want the page to appear to not even exist. So I would like to give a 404 error instead of a 403. Then have it render whatever 404 page would render if the resource really wasn't there.

How can I do that?

share|improve this question
Hey @JD Isacks - it'd be great if you'd accept an answer :) – Nathan J. Brauer Oct 30 '15 at 16:13

Redirect 404 will work but will execute across all domains pointing to your vhost. Since you're using multiple domains, you'll want to use RewriteRule:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^microsite\.someotherexample\.net$
RewriteRule ^path/to/page/?$ - [R=404,NC,L]
share|improve this answer

The documentation and AskApache suggest that you can simply use Redirect 404.

share|improve this answer

...what about actually removing it (or renaming it, or moving it away...)?

What's the point anyway of having it there if you want to make it not accessible at all?

share|improve this answer
I want it accessible to one domain and not another. I have more than one domain pointing to the same server. Most of the pages slightly adjust based on domain (logo, description, etc.) Some resources should appear to only be on 1 domain though. – JD Isaacks May 19 '11 at 20:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.