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
Unicode decode error "'utf-8' codec can't decode byte 0xfa in position 0: invalid start byte" when using MeCab
Aligning Facebook button and Twitter button
Using Python on Windows
The University of Tokyo Academic Archives Portal - UTokyo Digital Collections
UNESCO: `Do you know AI or AI knows you better? Thinking Ethics of AI'
UAV/UGV Autonomous Cooperation
Culture as the base of our country: Prof. Inose
Toward AI-embedded Society where AI is Not Recognized as AI
Difference between Science and Engineering
AI (Artificial Intelligence) and Philosophy
AI ELSI Award
Koichi Hori Top page
Koichi Hori
AI support for Ethical AI Design
What an old AI researcher thinks after watching the movie "Green Book" - about Racism, Discrimination, and AI (Artificial Intelligence)
Civilization, Culture, Science, and Technology
What is Artificial Intelligence?