Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter with Wordpress in a subdirectory
#1

[eluser]Unknown[/eluser]
Hey guys,

I need a hand on my site, I'm running it completely in CodeIgniter, but have decided to strap on a WordPress blog.

The directory of wordpress is /wordpress/

CodeIgniter isn't in the root, it's in /ci/

Have tried all the usual solutions, and I'm getting nowhere. I can access /wordpress/ fine, but any links within that are busted.

Here is my htaccess in the root:
Code:
php_flag magic_quotes_gpc off
php_flag register_globals off

<IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(images|css|js|swf|flv)\/(.+)\.(css|js|swf|jpg|png|gif|flv)$ visiontech/app/views/$1/$2.$3
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^e/([a-zA-Z\-_]+)/(\d+)$ np/preview.php?id=$2&outside=true [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

I've also read that I should put a htaccess in the WP directory, have put the following in, but not sure if it's even making it that far:
Code:
# -Wordpress-
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Any help would be awesome! Thanks guys,

JC
#2

[eluser]Unknown[/eluser]
LOL spammmmm
#3

[eluser]toopay[/eluser]
Try this one :
Code:
RewriteEngine On
RewriteBase /ci/

RewriteCond %{REQUEST_URI} ^wordpress.*
RewriteRule ^(.*)$ /worpress/index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci/index.php?/$1 [L]

And just suggest some alternative structure :
Code:
---  index.php(index for CI)
|_  .htaccess
|_  assets(folder for image, css, js, and so on)
|_  application(CI app folder)
|_  system(CI system folder)
|_  wp(wordpress folder)
In this way, you can have a htaccess like
Code:
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^wp.*
RewriteRule ^(.*)$ /wp/index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]




Theme © iAndrew 2016 - Forum software by © MyBB