Dev Guy
Dev Guy

Reputation: 520

Subdirectory Issue with CodeIgniter

I have installed a CodeIgniter application on main domain (domain.com). Now I wanted to use a directory for a blog (domain.com/blog/) where I would like to install a WordPress powered blog. But the issue is that I created a Directory called a blog but when I try to access it by typing domain.com/blog/ I get CodeIgniter 404 not fount page. I am very new with CodeIgniter so I must be missing something here.

Thanks

Upvotes: 2

Views: 105

Answers (1)

No Results Found
No Results Found

Reputation: 102864

Assuming you're using .htaccess to remove index.php from your URLs, you should have an .htaccess at the root of your project with something like this in it:

RewriteCond $1 !^(index\.php|robots\.txt|css|images)
RewriteRule ^(.*)$ index.php/$1 [L]

It's basically saying "Send all requests to index.php/$request unless they start with index.php, robots.txt, css, or images".

This is so you don't have to use URLs like http://example.com/index.php/controller/method.

Just add blog:

RewriteCond $1 !^(index\.php|robots\.txt|css|images|blog)
RewriteRule ^(.*)$ index.php/$1 [L]

Upvotes: 6

Related Questions