Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:

www.domain.com/directory

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

www.domain.com/directory/

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!

Thanks,

Danny

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

2 Answers 2

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/

or
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? http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryslash (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

 
discard

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.