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

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 (http://www.blah.com/abc) 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]
</IfModule>

But I have no clue what I need there.

G-Man

END WordPress

share|improve this question
add comment

2 Answers 2

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
add comment

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
add comment

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.