Welcome Guest, Not a member yet? Register   Sign In
Problems hosting WordPress in /blog alongside CodeIgniter 3 Application.
#1

I have a site which is built in CodeIgniter 3.

I'm using the following .htaccess file to remove index.php: 

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

My site is simple and only has a few routes (I'm using custom defined routes instead of File system based controller routing)
This is how my routes.php file looks like: 
Code:
$route['default_controller'] = 'MainController';
$route['404_override'] = 'MainController/override_404';

$route['not_me'] = 'MainController/Logout';
$route['(:any)'] = 'MainController/HostedPage/$1';
$route['confirm/(:any)'] = 'MainController/ConfirmEmail/$1';

$route['translate_uri_dashes'] = false;

I just installed Wordpress in a /blog folder (in the public_html alongside system & app)

The homepage of blog seems to be working well & so does the admin panel.
But trying to open any post (or accessing any route that is not a .php file in the /blog folder) returns a 404 error and yields the overrride_404 view specified above.

How can I prevent CodeIgniter from messing with WordPress & have it work normally ?

Any help is greatly appreciated. Thank you.
Reply
#2

You need to change your .htaccess to exclude that url.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(blog)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB