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.

Wordpress installed at root web directory:

/var/www/html/

CodeIgniter installed in a sub-directory:

/var/www/html/ciapp/

When I access http://www.mysite.com/ciapp/ the main CI controller is accessed and executed correctly.

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

http://www.mysite.com/ciapp/main/

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

http://www.mysite.com/ciapp/main/myfunction/

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]
</IfModule>

# 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

1 Answer 1

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? –  Jakobud 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. –  Jakobud 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? –  Jakobud Aug 2 '10 at 19:00

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.