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

Wordpress installed at root web directory:


CodeIgniter installed in a sub-directory:


When I access the main CI controller is accessed and executed correctly.

However, if I try to access my main CI controller directly like so:

I get Wordpress's 404 page. Also, if I attempt to access a function of my main controller like this:

I also get the same 404 page.

So basically, Wordpress is ignoring the /ciapp/ directory by default, but its not ignoring any URL requests that are added to it. Here is my Wordpress .htaccess:

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

So what kind of RewriteCond do I need to add to the Wordpress .htaccess for it to ignore the /ciapp/ directory and anything URI request that uses that directory as well?

I tried this:

RewriteCond %{REQUEST_URI} !^/?ciapp

But it didn't seem to have any effect.

share|improve this question

if url == any of these, do NOT use index.php to serve them.

RewriteCond $1 !^(index\.php|css|img|forums|ciapp|robots\.txt)

else, use index.php

RewriteRule ^(.*)$ index.php/$1 [L] 

if url == ciapp/* , use ciapp/index.php to server them.

RewriteRule ^(.*/)?ciapp/(.*) /ciapp/index.php/$1 [L]  
share|improve this answer
Can you clarify where in my .htaccess to put these? – Jake Wilson Aug 2 '10 at 18:48
Also that first condition you have there, you say the url has to == the things listed. So do I have to add every possible url for my CI app into that condition? That doesn't seem right. – Jake Wilson Aug 2 '10 at 18:50
I'm getting a 500 Internal Server Error on all pages when I add that last line in. Can you clarify where to put the code in the .htaccess? – Jake Wilson Aug 2 '10 at 19:00

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.