[typo] Redirects / and a themes question

Tobias Luetke tobias.luetke at gmail.com
Fri Jul 29 16:45:27 EDT 2005


I think it would be great if we could update the importer to "create"
.htaccess files and lighttpd snippets which would do the redirecting.
I'll look into this in the near future

On 7/29/05, Kevin Ballard <kevin at sb.org> wrote:
> On Jul 29, 2005, at 2:18 PM, gpshewan wrote:
> 
> > On 29 Jul 2005, at 16:09, Scott Laird wrote:
> >
> >>
> >> You could also add a RedirectMatch line that redirects /200(.*)
> >> to /articles/200$1
> >>
> >>
> >
> > Ah that's the thing though, I couldn't figure out/get to work any
> > kind of redirect.  I tried a tonne of different redirects and regex
> > but nothing seemed to work, so in the end it was easier to look at
> > how Typo was handling it.
> >
> > Actually I've been looking at it again, and tried something that
> > isn't as 'destructive'.  I duplicated the routing information that
> > was there and ended up with this:
> >
> >   # allow neat perma urls
> >   map.connect 'articles/:year/:month/:day', :controller  =>
> > 'articles', :action => 'find_by_date', :year => /\d{4}/, :day =>
> > nil, :month => nil
> >   map.connect 'articles/:year/:month/:day/:title', :controller  =>
> > 'articles', :action => 'permalink', :year => /\d{4}/
> >   map.connect ':year/:month/:day', :controller  =>
> > 'articles', :action => 'find_by_date', :year => /\d{4}/, :day =>
> > nil, :month => nil
> >   map.connect ':year/:month/:day/:title', :controller  =>
> > 'articles', :action => 'permalink', :year => /\d{4}/
> >
> > That means that I keep Typos form of clean urls for future posts,
> > and yet any requests that come from SE's for old posts are still
> > handled okay.
> >
> > Don't see any issues with it in testing and I like it better than
> > the other solution.
> 
> The problem is ideally, the old URLs should be redirected to the new
> ones. You can do that with mod_rewrite, but to do it with routes
> you'd have to add a new method to a controller as well to do the
> redirect.
> 
> --
> Kevin Ballard
> kevin at sb.org
> http://www.tildesoft.com
> http://kevin.sb.org
> 
> 
> 
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list
> 
> 
> 
> 


-- 
Tobi
http://www.snowdevil.ca - Snowboards that don't suck
http://typo.leetsoft.com - Open source weblog engine
http://blog.leetsoft.com - Technical weblog



More information about the Typo-list mailing list