Add blog to web app

Hi all,

I created a web app with CakePHP. 95% of the web app is the app itself and about 5% of it is the landing page and a bit of a description on what it does.

I just decided that I want to add a simple blog to the web app. An area accessible to users who have not logged in.

I thought this would be a relatively simple thing to do but from my research it seems quite difficult.

From my research I read that WordPress is the leader in blogs and this was the most recommended of all. I then read that for the best SEO ranking you should have the blog in a sub-folder instead of a sub-domain. This is where it gets hairy. It seems like going to get quite messy if I drop WordPress in a blog folder on my root webdirectory.

Eg blog.mycoolsite.com (Uses subdomain and seems to be the simplest way to proceed however not as good for SEO ranking)

www.mycoolsite.com/blog (Best for SEO ranking but looks difficult to make it work with my existing web app)

I have looked at other blog options like Ghost, Tumblr etc but I’m still leaning towards WordPress. I have never built anything with WordPress and wanted to avoid having to but I can’t see any other way to acheive this?

I even considered writing my own blog but there is so many features that come out of the box with WordPress that I would not want to build my own.

I’m starting to think it may be best to have a 100% WordPress site with a blog then have a sign in button that links to my separate web app that has the same theme and look and feel. Eg app.mycooltesite.com (The landing page will in essence be the login page.)

Has anyone been in this scenario before and/or have any ideas of how I could achieve this?

Many thanks

@cmac: The problem you will get if you put your blog at www.mycoolsite.com/blog is that the Cake System will intercept all blog-related page requests and then try and find the, probably non-existant BlogController, to process them. Disaster will obviously follow.

The way round this will be to edit the .htaccess file which by default looks something like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]   # !!!! EDIT this line
</IfModule>

You will need to edit the line highlighted so that instead of redirecting every request to Cake’s webroot folder, you redirect everything except requests that begin blog.

This feels like something that Middleware could also handle.

This would give you a code based solution rather than a server based solution. I have no idea which would be better.

Why not build a simple blog mvc? You can make it public, it just needs index and view files, and your navbar, etc. will match. Just add the blog content in through the database, or if you have an admin panel, use that to add in your content.