0

I have a Code Igniter URL: www.example.com which is working perfectly.

Now I created a folder in the root document named as pages and installed wordpress inside this 'pages' folder.

I was expecting that when I will access www.example.com/pages, I will get the wordpress pages, but when I open www.example.com/pages it automatically redirects to http://www.example.com/login

Thus I am unable to view my wordpress pages.

What I have tried: I changed .htaccess file to redirect but it didn't work. I also checked the database of wordpress but didn't find anything. Default site (Code Igniter) has different database then Wordpress.

My .htaccess file which is located at www.example.com is like this:

<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On

# If your website begins from a folder e.g localhost/my_project then
# you have to change it to: RewriteBase /my_project/
# If your site begins from the root e.g. example.local/ then
# let it as it is
RewriteBase /

# Protect application and system files from being viewed when the index.php is missing
RewriteCond $1 ^(application|system|private|logs)

# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]

# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|public|assets|css|js|images|pma  \.php|uploads|assets)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>
Cœur
  • 37,241
  • 25
  • 195
  • 267
Abhishek dot py
  • 909
  • 3
  • 15
  • 31
  • Wouldn't Codeigniter be looking for a controller named `pages` by default? Is this something you need to update in your routes? [Docs](http://ellislab.com/codeigniter/user-guide/general/routing.html) – Jbird Sep 14 '13 at 16:28
  • [Check this](http://thedaylightstudio.com/blog/2010/06/16/codeigniter-and-wordpress-integration) and these answers too ([one](http://stackoverflow.com/questions/17829990/codeigniter-wordpress-integration) and [two](http://stackoverflow.com/questions/4608550/how-can-i-integrate-wordpress-with-codeigniter)). – The Alpha Sep 14 '13 at 19:13
  • @jbird: I have used WordPress but absolutely new to CI. – Abhishek dot py Sep 15 '13 at 04:56
  • @SheikhHeera: No this is not working. After trying what was in those pages, I can't still open page. – Abhishek dot py Sep 15 '13 at 10:24
  • @jbird: I have added following lines >>> $route['pages/(:any)'] = 'blog/$1'; $route['pages'] = 'blog'; <<< I wanted pages url to redirect inside folder blog. But this is not working. – Abhishek dot py Sep 15 '13 at 10:25

1 Answers1

0

Friends,

I have fixed this myself. I did a redirect in .htaccess file like this:

RewriteBase /page/

Plus, previously I was using seperate database for CI and Wordpress. I merged the database.

Abhishek dot py
  • 909
  • 3
  • 15
  • 31