Putting Chyrp Blog in a Subdirectory

Today I decided that I wanted my blog in a subdirectory so that I could just have a super simple (and slightly silly) home page. So I just made the index.html file for the new home page, made a subdirectory in my main website directory and then moved all the chryp files in there. Whoops I broke the blog.

This is what you do to fix your chyrp blog if you do what I did:

<

ol>

  • Go to your admin settings page (your-domain/admin/?action=settings), you will have to manually enter the URL because the paths are all screwed up, but that's what we're about to fix. See the field "Website URL"? Fix that to include the subdirectory but don't include a trailing slash.
  • Now it should sort of work, at least the home page will but if you click to read a blog post it will break. That's because we forgot to move the .htaccess file over. Or at least I did. So move that from your webroot to the subdirectory.
  • Last step, edit the .htaccess file so that instead of it saying "RewriteBase /" at the top make it say "RewriteBase /sub-dir-name".
  • That's it.
  • Silly easy, but the chyrp community is really small and I couldn't find any info about this little chore. But it's here now! Hooray!

    Oh yeah, I am running a pretty old version of chyrp, 1.1.3.2 to be exact. The steps described may no longer be applicable to more recent versions.

    9/14/08 Update: If you've moved an existing blog, then there's one step I left out if you want to preserve any existing links to your blog. You need to setup a rewrite rule in your webroot's .htaccess file to transfer any old content to the new blog location. I used the following:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* blog%{REQUEST_URI} [R]
    

    09:37 PM | 0 Comments