Koichi Hori

Home About

   日本語

Redirecting URL in Ruby on Rails

(Diary of an Old AI Researcher who is still Programming)

2 July 2019

I am retiring from University of Tokyo in March 2022, and, perhaps, my homepage in ailab.t.u-tokyo.ac.jp will be shut immediately at that time.
I have checked the access statistics of my home page and have found that the page titled `Difference between Engineering and Science' has an extremely high access score and is cited in several sites. So, I have decided to redirect the page in ailab.t.u-tokyo.ac.jp to the page in koichihori.tech right now.

However, this is not so easy, because my page is dynamically generated by my own program and I should rewrite my program.

It took a while before I recalled what my program, which I wrote six years ago, is doing. :-)

Finally, I have inserted the following four lines in one of my controller programs built in the framework of Ruby on Rails.
('status 301' means this redirection is permanent.)

 
 if params[:id] == "9"
     redirect_to("https://www.koichihori.tech/kougaku_jp.html", status: 301)
     return
 end


I do not think this is a beautiful solution, but, it is working.


CC0
To the extent possible under law, the person who associated CC0 with this work has waived all copyright and related or neighboring rights to this work.




Related entries (automatically calculated):
Using unicode characters in Windows command line
css <pre> and <code> for mobile devices
Showing the favicon in Google search results
Login window freezes when making VNC connection from Windows to Mac
Unicode decode error "'utf-8' codec can't decode byte 0xfa in position 0: invalid start byte" when using MeCab
Using Python on Windows
Aligning Facebook button and Twitter button
On This Day: Atomic Bomb Dropped on Nagasaki
Koichi Hori: Last Lecture
UNESCO: `Do you know AI or AI knows you better? Thinking Ethics of AI'
Mechanical engineers and electrical engineers have different mental models of oscillation
The University of Tokyo Academic Archives Portal - UTokyo Digital Collections
UAV/UGV Autonomous Cooperation
Culture as the base of our country: Prof. Inose
Difference between Science and Engineering
A small program which extracts rhythmic word sequences such as Tanka(57577) or Haiku(575) from a plain text
Toward AI-embedded Society where AI is Not Recognized as AI
AI (Artificial Intelligence) and Philosophy
What an old AI researcher thinks after watching the movie "Green Book" - about Racism, Discrimination, and AI (Artificial Intelligence)
AI ELSI Award
AI support for Ethical AI Design
Koichi Hori Top page
Civilization, Culture, Science, and Technology
Koichi Hori
What is Artificial Intelligence?