Installing another CMS alongside Wordpress

I’m moving my site from Wordpress to ExpressionEngine but because most of the site’s content is in blog posts, I don’t want to move that right now and so want to the deliver the main part of the site from EE and the blog from WP but still retain URLs for the blog posts.

All the blog posts are in a top level category called articles with URLs like /articles/post-title/ or /articles/subcategory/post-title/, so I thought I should move the WP installation to an /articles/ folder. That’s fine except I end up with permalinks like /articles/articles/post-title/ or if I take the category out of WP’s permalink structure, I get correct URLs for posts that don’t have subcategories, but not for ones that do.

The reason for moving WP is because both EE and WP will run from an index.php file in the root directory, so I’m trying to avoid that conflict. Although I suppose it’s possible to rename one of those index files to something else and have the .htaccess replace that file, e.g. site.php instead.

So should I be moving WP to a new folder or leaving it where it is, and in either case, what do I need in my .htaccess file/s to do it?

Sounds to me like you’d be better off moving WP to an /articles/ folder, thus getting URLs like /articles/articles/post-title/, then removing the first /articles/ via htaccess (as the two index.php files in the root folder couldn’t work).

Might be best, therefore, to move this thread to the Apache forum, where there is good help with that sort of thing. Is that OK with you?

As for moving the WP posts to EE, were you planning to do that manually (I mean, post by post)? I’ve met people who simply modify the database and do that in a jiff, though that’s over my head.

Yep.

I can import posts and comments via XML into EE but that’s a task for further down the road. The long-term goal is to completely redesign the site but it’s been a long process so I’m just trying to get things done in smaller chunks.

OK, post moved to Apache configuration.

There’s lots of good advice here for rewriting URLs, but I’m not confident enough to claim to know the best solution for this, though it should be fairly simple. Perhaps this is the most relevant section:

Rename Your Directories

You’ve shifted files around on your site changing directory name(s):

# mod_alias can do this faster without the regex engine
RewriteEngine on
RewriteRule ^old_directory/([a-z/.]+)$ new_directory/$1 [R=301,L]

I’d do it differently.

  1. Rename the index.php from WP to index-wp.php
  2. Remove the standard WP generated lines from the .htaccess
  3. Put this in your .htaccess instead

RewriteCond %{REQUEST_URI} ^/article
RewriteRule .? index-wp.php [L]

  1. Leave the .htaccess code for EE intact, and make sure you put the code from (3) above the EE code in the .htaccess

That way all URLs that start with /articles will be directed to index-wp.php (and thus served by wordpress), while all other URLs will be directed to index.php (and thus served by EE).

Nice suggestion, Remon. I was hoping you’d jump in here. :smiley:

Thanks Rémon, that’s nearly there. :slight_smile:

The individual posts seem to have the correct URLs, but there’s a problem with archive and tag pages. Anything served from WP that doesn’t start with /articles/ returns a 404, e.g. /archives/ and /tags/. This also affects all the category archive pages which start with /category/archives/category-name/.

It’s also affected search results too. Even though I’ve changed the search forms to point to index-wp.php, they’re either not returning results or giving a 404.

You can simply extend my code to pass other directories to WP as well


RewriteCond %{REQUEST_URI} ^/(article|archives|tags)
RewriteRule .? index-wp.php [L]

and you can add more in a similar manner. As for the search option, I think I have to see it before I can say anything about that. Is the site online?

Thanks Rémon, that’s fixed up everything except the search. :smiley:

Not yet, still working on it locally. Probably will be some time this week.

Please point me to the site when it’s up and I’ll have a look at the search :slight_smile: