【发布时间】:2012-10-20 04:59:58
【问题描述】:
我需要将任何域名的第一个子域重定向到该 Web 服务器的根文件夹到一个子文件夹。
- 需要保留传入端口(愚蠢的 isp 阻塞端口 80 和 443)。
- 它需要能够同时处理 http 和 https。
- 需要忽略 www.whateverthedomain.ext
例如
- dom1 : mydummy.com
- dom2 : toberedirected.net
- dom3 : putanydomainhere.ca
可能的传入网址
- http(s)://firstsub.mydummy.com:8082
- http(s)://whateveryoutypehere.thegoodsub.toberedirected.net
- http(s)://firstsub.mydummy.com/firstsub/
- http(s)://www.mydummy.com/
3个传入url的结果应该是
- http(s)://firstsub.mydummy.com:8082/firstsub/
- http(s)://thegoodsub.toberedirected.net/thegoodsub/(我不在乎第一个 sub 前面是什么)
- http(s)://firstsub.mydummy.com/firstsub/(不要重写,不是根文件夹)
- http(s)://www.mydummy.com/(不要重写,忽略 www 并给出域的默认网页)
这可能很容易写,但我今天早上想不通。
【问题讨论】: