1 jibberjab Nov 21, 2005 03:16
3 jibberjab 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 blueyed 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 kweb 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 personman 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.
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 ?