Welcome Guest, Not a member yet? Register   Sign In
Excluding a uri from Codeigniter handling it?
#1

[eluser]behdesign[/eluser]
I've installed Wordpress to the /blog subdirectory of my web project that otherwise uses Codeigniter. How do I configure CI to ignore requests to the Wordpress directory so I can finish installation and use the admin interface. Eventually, I'll AJAX the content from the blog into the pages in CI, so keeping the content in the same domain is important.

Thanks!
#2

[eluser]Jelmer[/eluser]
The issue is with the rewriting of the server: you don't tell CI to ingore it because it should never reach CI to begin with.

Rewriting is probably done with a .htaccess file like the example in the User Guide:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

You have to add "blog" to the paths to ignore, by adding it to the RewriteCond:
Code:
RewriteCond $1 !^(index\.php|images|robots\.txt|blog)

If your .htaccess looks a lot different you have to find the RewriteRule line that rewrites to the index.php and add an additional RewriteCond:
Code:
RewriteCond $1 !^(blog)
#3

[eluser]richthegeek[/eluser]
there is another way to do it, which is with a "file/dir exists" condition;
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

That will catch any files that exist on the server and stop them being passed to CI.
#4

[eluser]Jelmer[/eluser]
That's my preferred way as well, however that would still supercede any rewriting rules for Wordpress - so you still need a RewriteCond for /blog/




Theme © iAndrew 2016 - Forum software by © MyBB