Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Let's say I have a domain,
And I ordered a new domain,

Both domains are hosted in the same ISP, so currently requests to either of those addresses result in the same page being shown.

I want to redirect all requests to to folder /wp so that when users access they would see whatever is inside folder /wp without seeing the URL change.


  1. How can I achieve this using .htaccess?
  2. How can I prevent users from accessing directly /wp directory (meaning that would be blocked)?
share|improve this question

migrated from Apr 10 '10 at 20:12

This question came from our site for computer enthusiasts and power users.

mod_rewrite can do both of those.

For the first, check the host with RewriteCond and write a rule to rewrite it without using the R flag.

For the second, check the host for and write a rule that rewrites anything back to itself with a R=404 flag.

share|improve this answer

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.