I''m rebuilding my site and with google i''m getting a load of requests for .php or .aspx files which the previous site was built on. Is there any way of redirecting these www.mysite.com/index.aspx requests to the /index action via the routes, maybe a wildcard, so google sitemaps doesn''t list those old links as errors? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 7 Oct 2008, at 12:22, John Griffiths wrote:> > I''m rebuilding my site and with google i''m getting a load of requests > for .php or .aspx files which the previous site was built on. > > Is there any way of redirecting these www.mysite.com/index.aspx > requests > to the /index action via the routes, maybe a wildcard, so google > sitemaps doesn''t list those old links as errors?You could do this via a mod_rewrite rule, or if you just want rails to accept those urls, you should be able to do that by adding a pseudo mime type (in the same say that you can do to yourapp/orders.xml and get an xml representation, you should be able to add pseudo types for php and aspx that just behaved the same as the html ones) Fred> > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ok, so if i add a type for php, Mime::Type.register "application/x-httpd-php", :php and then something in my route.rb to redirect any .php calls to the appropriate place i should be ok? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---