Hamza
Hamza

Reputation: 1085

Wordpress + Codeigniter htaccess confusing

I have Wordpress installed in the root directory with the following htaccess :

# BEGIN WordPress
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>
# END WordPress

and I have Codeigniter installed in a sub-directories named members, with the following htaccess :

RewriteEngine on
RewriteBase /members/
RewriteCond $1 !^(index\.php|images|templates|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

When I try to access any controller via : site.com/members/controller/function I get the Wordpress 404 error page

Upvotes: 1

Views: 1840

Answers (2)

Vaimeo
Vaimeo

Reputation: 1138

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

Upvotes: 1

Birdman
Birdman

Reputation: 724

In your CI config.php, set your base url as

$config['base_url'] = 'http://site.com/members/'

and change

 RewriteBase /members/ 

to

RewriteBase /

in your CI .htaccess file. This way when you access CI, it doesn't look in the root (which is WP), it goes straight to it's directory and bypasses WP.

Upvotes: 4

Related Questions