tmonk
Hi all , 想請問 middle2 怎麼把預設的 domain name 下架 ? 跪求教學。 我只知道如何在 middle2 的控制面板掛上新的 domain name, 但預設的就是不知道從那操作,網路上也找不到教學 😅

wildjcrt
幫 cue @ronnywang

ronnywang
預設的不能下架喔,不過在自己的程式內可以做導向

tmonk
我在程式內對 root directory 的 routing 加了這個 if-else 判斷,在 local 端有成功做到導向,但不知道為何 repo 上去後,網址是有導過去,但原本 render 的 view 就沒出來了。
```
app.get('\', function(req, res){
if(req.host=="taitung-fan-182028.middle2.me"){
res.redirect(301,'http://reformspace.taipei/')
}else{
res.render('index', {
title: req.app.get("appName")
});
}
});
```
修改前的程式碼
```
app.get('\', function(req, res){
res.render('index', {
title: req.app.get("appName")
});
});
```
```
app.get('\', function(req, res){
if(req.host=="taitung-fan-182028.middle2.me"){
res.redirect(301,'http://reformspace.taipei/')
}else{
res.render('index', {
title: req.app.get("appName")
});
}
});
```
修改前的程式碼
```
app.get('\', function(req, res){
res.render('index', {
title: req.app.get("appName")
});
});
```