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

I have a wordpress blog that is installed on the root of my domain.

I have put another piece of software in a subdirectory.

When I try to access the subdirectory ( I get a 404 error from wordpress.

I've done some reading and it looks like I need to have a rewritecond and a rewrite rule before the rewritebase below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

But I have no clue what I need there.


END WordPress

share|improve this question
up vote 1 down vote accepted

RewriteCond %{REQUEST_FILENAME} !-f

Says that if a file exists with that name, do not rewrite it.

RewriteCond %{REQUEST_FILENAME} !-d

Says that if a directory exists with that name, do not rewrite it.

So your .htaccess should be all set already. Check the permissions on your new directory to make sure it is readable by the webserver (i.e. 755 or similar) and do the same with the files in the directory.

share|improve this answer

Indeed, you want to prevent rewriting if /abc is requested. The additionnal RewriteCond should be :

   RewriteCond %{REQUEST_URI}!^/abc/

Place it right before the existing RewriteRule line. It means the requested URI should not start with "/abc/" for the following rule to be applied.

share|improve this answer
That gives me an internal server error. I copy/pasted that into my htaccess and changed abc to the name of my folder. – GeoffreyF67 Dec 21 '09 at 21:07
What error do you have in the logs ? I just realized the htaccess file you posted should already not rewrite /abc if the directory exists at the root of your web directory because of the second RewriteCond. – François Feugeas Dec 21 '09 at 21:16

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.