Welcome Guest, Not a member yet? Register   Sign In
Wordpress alongside CI
#1

[eluser]nelson.wells[/eluser]
I've searched the forums for how to do this, and the solution (I thought) was told in this thread

http://ellislab.com/forums/viewthread/136673/

Like the poster in this thread, I have CI on the root and a blog folder on root as well. The URL to the blog should be www.domain.com/blog . My .htaccess is rewritten so that CI will ignore everything in the blog folder, but when I try to view individual posts or even the index of the blog (www.domain.com/blog/index.php), I get a blank page. The odd thing is that the Wordpress admin pages work (www.domain.com/blog/wp-admin). Any idea what I am doing wrong? Here is my .htaccess

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^apt.nelsonwells.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.apt.nelsonwells.net$
RewriteRule ^(.*)$ "http\:\/\/google\.com" [R=301,L]

RewriteCond $1 !^(index\.php|assets|blog|images|dev|sitemap.xml|info.php|hi.php|red.jpg|blue.jpg|yellow.jpg|ee|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#2

[eluser]bretticus[/eluser]
The great thing about htaccess files is that they override the parent htaccess file. Have you tried an htaccess file in your blog folder?

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
#3

[eluser]nelson.wells[/eluser]
Thanks for that, but it didn't work. I looked into the index.php page of the WP install, and it was empty. Maybe it didn't install correctly? I moved the index.php from my local machine to my web server and it worked. I hope there is nothing else wrong with the install. Thanks for the help.
#4

[eluser]bretticus[/eluser]
I have always been able to copy new WP installs over the top of previous ones without any issues whatsoever:

Quote:wget http://wordpress.org/latest.tar.gz

tar xzvf wordpress-2.9.2.tar.gz

cp -rv wordpress/* blog/
#5

[eluser]jwindhorst[/eluser]
I'm running into the exact same problem. Initially I set up our blog as a subdomain, blog.example.com but now for numerous reasons I would prefer to make it www.example.com/blog. The initial posts come up, but the permalinks are all throwing 404 errors. The errors are coming straight from apache so it looks like htaccess is properly avoiding CI but I still can't get a specific blog entry to show.

Anyone else have any more thoughts on this?
#6

[eluser]jwindhorst[/eluser]
I guess sometimes you just need to say it outloud right? Or at least type it!

So, for Nelson and bretticus and anyone else that might read this, there is a very easy and admittedly rather stupid fix for this problem. You have to actually do what word press tells you to do! (I'm not being insulting here, and fell into the same trap)!

First off, there are two entries in the wp-options table that will need to have the URL fixed in them. A quick search for SELECT * from wp_options where option_value like '%domain%' should bring them right to the front for you.

That part was pretty easy for me to find. The real key however was logging into the admin section and going to the Settings > Permalinks section. Near the bottom of that page they GIVE you what you need to put in your www.domain.com/blog/.htaccess file. To Bretticus' point, this will override the .htaccess in your root directory. Very thoughtful of them to just give you the answer don't you think? If only I read more!

Hope this helps someone!
#7

[eluser]bretticus[/eluser]
Yep, I just setup a Directory directive in apache with rewrite rules. Never had a single problem from the get-go. And that is ALL I had to do.

Don't recall if I used the option to have WP create a .htaccess file for me or not. But if you have certain apache directives disabled in .htaccess files as I do, they could cause server errors (this does not apply to most hosting plans.) I actually had to create a blank .htaccess file with limited permissions so that WP would not rewrite that file every time I went to those WP settings.

Cheers!




Theme © iAndrew 2016 - Forum software by © MyBB