1

WordPress is installed in the root web directory:

/var/www/html/ 

CodeIgniter is installed in a sub-directory:

/var/www/html/ciapp/ 

When I access http://www.example.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.example.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.example.com/ciapp/main/myfunction/ 

I also get the same 404 page.

So, basically, WordPress is ignoring the /ciapp/ directory by default, but it's 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 any URI request that uses that directory as well?

I tried this:

RewriteCond %{REQUEST_URI} !^/?ciapp 

But it didn't seem to have any effect.

1 Answer 1

0

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] 
3
  • Can you clarify where in my .htaccess to put these? Commented Aug 2, 2010 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. Commented Aug 2, 2010 at 18:50
  • 1
    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? Commented Aug 2, 2010 at 19:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.