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

I am using a (dv) server from Media Temple, and I have wordpress installed on the root of my domain.

I have a directory called support that holds a standard xhtml webpage, but if the user enters the domain name as follows:

the wordpress page not found shows up, however, if the user enters:

the xhtml page shows up.

Is it possible to force the server to direct anyone who types /directory to /directory/?

Sorry if this isn't making much sense!



share|improve this question
what type of server? Nginx, IIS, Apache, something creative? – GruffTech Aug 18 '10 at 18:31
up vote 0 down vote accepted

If this is a Linux server it should happen anyway as you can't have a file and a directory in the same place with the same name - I'd guess that the request is being rewritten so maybe your .htaccess file would help here.

Aside from that, the following in your .htaccess should do it:
RewriteEngine On
RewriteRule ^directory$ directory/

Alias /directory /directory/

share|improve this answer
Worked a charm, thanks! – dannymcc Aug 18 '10 at 18:45

the behaviour you are asking for is the DEFAULT in any sane server for good reasons...

assuming it's apache, maybe your hoster disabled THIS? (it would be a really bad idea to do that globally on a shared hosting server, if it's the case, do complain about it...)

also read that entry to understand WHY that behaviour is the default...

share|improve this answer
actually, most likely it's due to some rewriterule(s) in your htaccess file for wordpress that overrides the default behaviour... usually you would have a rule in there that passes requests for existing files to the default handling... – r00t Dec 20 '10 at 19:17

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.