Recent Topics

1 Nov 21, 2005 03:16    

I'm considering turning one of my categories into a blog of its own. I have the backoffice set up so that I can crosspost between blogs, so the actual process of moving all the posts will be very easy as once I create the new blog I can just reassign the posts from one blog to another.

However, is there any way to deal with the broken search engine and RSS links that this will create? Can posts re-ping once they've already pinged, or would a better option (though it would be a nightmare) be to set up 301 redirects for each of the moved posts, pointing to their new locations? Or should I just say to h3ll with it and move 'em?

jj.

2 Nov 21, 2005 03:52

This seems like a good job for .htaccess. I'm not too great with it, but can't you do a rewrite rule that says when someone goes to oldstubfile.php/permalink/blah/blah it gets rewritten to newstubfile.php/permalink/blah/blah ?

3 Nov 21, 2005 04:36

Yes, you can. The syntax is as follows:

RedirectMatch permanent ^/oldpath/to/articlename$ http://www.yourdoman.com/newpath/to/articlename

This creates a 301 server redirect (content moved permanently). The first part, where you name your old article, should only list the path after the domain root. The part after that path statement must include the entire new url to the new article location.

However, a separate entry has to be added for each moved page. Hence the potential nightmare scenario and one jungle of an .htaccess file.

So much for really planning ahead when I dove into this blogging thing! Retrofit! Retrofit! Retrofit!

jj.

4 Nov 22, 2005 06:11

jibberjab, look at mod_rewrite.

It offers RewriteRule and you can create awesome things with it. See the apache docs.

Even with RewriteMatch you could (AFAIK) use regular expressions to match all your posts.

5 Nov 22, 2005 17:58

Shouldn't you just be able to do this?

Redirect permanent /oldpath/to http://www.yourdoman.com/newpath/to


I believe that would cover all your articles. It would forwared everything under /oldpath/to/ to the same URL under /newpath/to/

6 Nov 22, 2005 21:29

jj, I was just looking at the /conf/_advanced.php file in the CVS version and I saw this:


/**
 * If a particular post is requested (by id or title) but on the wrong blog,
 * do you want to automatically redirect to the right blog?
 *
 * This is overly usefull if you move posts or categories from one blog to another
 *
 * If this is disabled, the post will be displayed in the wrong blog template.
 *
 * @var boolean Default: false
 */
$redirect_to_postblog = false;

That's pretty cool. Once you're on Phoenix, then even old permalinks should end up at the right post if you set that to true. This may not help now, but that could be a very valuable feature.


Form is loading...