Using Codeigniter inside Wordpress

1

I'm working on a blog in which within a specific page it has an iframe that points into the server itself, calling a folder containing CodeIgniter running.

Until a few days everything worked, this on the old server. I had to switch servers and on the current server it does not work. The only page it opens is the page set in codeigniter to be the initial one, when I need to access a controller I get a 404 error.

Wordpress tries to access a folder, and indeed this folder does not exist, for example I inform the following url: server.com.br/codeigniter/controller/action/

>

Instead of entering the controller and looking for the action it looks for folders and obviously these folders do not exist, I created folders with these paths and it got the index that I placed inside the folder "action", but this is not what I need. I need it to behave like a framework.

I need a way that when I point to server.com.br/codeigniter/ he understands that it is no longer to behave as if it were the blog, and start to behave as a framework.

I do not understand anything .htaccess is one of my worst points as a programmer, I tried a good part of the day to fix a solution with htaccess, however, as you can see I had no success, I'm not sure if the correct way to solve this problem would be with htaccess, but it was the only possible output I encountered.

Follow htaccess's wordpress:

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

And also codeigniter htaccess

RewriteEngine on<br/>
RewriteCond %{REQUEST_FILENAME} !-f<br/>
RewriteCond %{REQUEST_FILENAME} !-d<br/>
RewriteRule ^(.*)$ /index.php?$1 [L]<br/>
If I enter codeigniter directly through a subdomain the program runs perfectly, however, I can not access the iframe with a subdomain, as I need to retrieve data / variables from within the iframe with jQuery / Ajax, if I use a subdomain this is not possible, I need a way that makes the blog understand that when it is server.com/codeigniter it starts to use the htaccess of codeigniter, or else it enters the controllers instead of searching for folders, (I believe this be the solution.)

    
asked by anonymous 03.06.2014 / 20:43

1 answer

2

I was able to solve my problem, I needed to discover some new functions of .htaccess that I did not know, the problem is that I have many doubts in mind and I can not kill doubts in Google, do what ... >

Follow my resolution, maybe help someone.

.htaccess of the framework looks like this:

Options +SymLinksIfOwnerMatch
RewriteEngine on

RewriteBase /online/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [L]
  • I needed to add RewriteBase to it to redirect the framework's root folder.
  • Apparently in RewriteRule I passed the framework index and the controller / action parameters.
  • The first line I do not know what it's for.
  • 04.06.2014 / 16:47