エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Goのサーバーでredirect処理する - uokadaの見逃し三振は嫌いです
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Goのサーバーでredirect処理する - uokadaの見逃し三振は嫌いです
package main import ( "net/http" ) func RedirectHandler(w http.ResponseWriter, r *http.Request) {... package main import ( "net/http" ) func RedirectHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") w.Header().Set("location", "http://www.yahoo.co.jp/") w.WriteHeader(http.StatusMovedPermanently) // 301 Moved Permanently } func main(){ http.HandleFunc("/rd", RedirectHandler) http.ListenAndServe(":3030", nil) if err != nil { log.Fatal("ListenAndServe: ", e