WordPress Development Stack Exchange is a question and answer site for WordPress developers and 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've been having some issues with my Wordpress install allowing me to access subdirectories, specifically a CodeIgniter install at mydomain.com/codeigniter. I know that technically it should work just fine as-is and recognize folders as they are created. However, this is not happening. I suspect it has something to do with a plugin, but I've tried disabling all of them and the problem still occurs (directs me to the Wordpress 404 page).

I've found a solution in the meantime, however. If I create a subdomain, something changes and everything works like it should, accessing the folder both via the direct path and via the subdomain name.

Any help? I've tried all sorts of fun stuff with my .htaccess files in both directories, but changing them doesn't do anything.

Update: Here's the Wordpress .htaccess in the root folder:

DirectoryIndex index.php index.htm index.html
AddHandler application/x-httpd-php52 .php .php5 .php4 .php

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?codeigniter/
RewriteRule . /index.php [L]

# END WordPress

And the CodeIgniter .htaccess file in the /codeigniter/ subdirectory.

DirectoryIndex index.php index.htm index.html
AddHandler application/x-httpd-php52 .php .php5 .php4 .php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /codeigniter
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
share|improve this question

migrated from stackoverflow.com Feb 4 '11 at 14:09

This question came from our site for professional and enthusiast programmers.

Can you please add your .htaccess here? – borayeris Feb 4 '11 at 7:30
Do you have a copy of your .htaccess file I can see? – Paul Calabro Feb 4 '11 at 7:32
@Jeff Wain - I'm not completely clear what your question is. It sounds like you've got a solution, so what you are looking for? And as far as the .htaccess files, do they work for you or not? – MikeSchinkel Feb 4 '11 at 14:14
up vote 3 down vote accepted

Even though static files and directories do work with a mod_rewrite'd wordpress installation in the servers root you might need to exclude your CodeIgniter subdirectory from that mod_rewrite lineup.

You can do so by placing an additional .htaccess file into the CodeIgniter directory and disable mod_rewrite in there:

<IfModule mod_rewrite.c> 
RewriteEngine off

Related: apache - Disable mod_rewrite for subdirectory

This normally does the job for me. But it can be less trivial in case that subdirectory needs a mod_rewrite configuration on it's own (as some PHP Frameworks need).

To understand how the apache configuration works, please see Configuration Files (Apache Manual) and AllowOverride directive (Apache Manual).

share|improve this answer
Ok, this works! I tested it out without the subdomain applied and it seems to be working, but I'll see over time if Wordpress decides to overwrite things again before I get rid of it. :) – Jeff Wain Feb 4 '11 at 15:07
@Jeff Wain to prevent such, just put it in a .htaccess file of it's own (e.g. in the subdirectory). Wordpress will only modify the .htaccess file in the installation directory. You can additionally put that into the apache server configuration. That won't get overwritten by Wordpress as well. – hakre Feb 4 '11 at 16:52
Perfect, thanks for the explanation. – Jeff Wain Feb 6 '11 at 4:05

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.