Gaurav Narula
Gaurav Narula

Reputation: 472

Codeigniter 404 Page Not Found for Sub Domain where WordPress Blog is installed

I am working with Codeigniter and WordPress for a website.

Codeigniter installed on the root directory. WordPress which is used for the blog in the subdomain directory inside the root folder.

Here is the directory structure.

var/www/html/codeigniter -- Root website here

/var/www/html/codeigniter/blog -- sub-domain for wordpress blog

here is the .htacess file for Root Directory (var/www/html/codeigniter)

# 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>

here is the.htaccess file for the blog directory (/var/www/html/codeigniter/blog)

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

Upvotes: 0

Views: 246

Answers (2)

Gaurav Narula
Gaurav Narula

Reputation: 472

it's working. I accidentally put the blog directory into another directory. Moving the blog on subdomain directory is working now.

Upvotes: 0

masteraamie
masteraamie

Reputation: 1

The subdomain you are trying to access must have a route associated to it in the application/config/routes and it should be pointing towards a valid controller function that returns a valid HTML/JSON data

Upvotes: 0

Related Questions