0

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

2 Answers 2

1

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.

1

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.

2
  • That gives me an internal server error. I copy/pasted that into my htaccess and changed abc to the name of my folder. Dec 21, 2009 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. Dec 21, 2009 at 21:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .