Apache 子域和域重定向
我有以下情况需要解决,我有一个域和一个子域指向同一资源。
www.mydomain.com 和 sub1.mydomain.com
我想要实现的目标如下:
我希望子域
将其根重定向到系统的子文件夹。 所以 sub1.mydomain.com --> sub1.mydomain.com/subdomainsrootfolder/sub1/
当请求的 uri 不低于“/subdomainsrootfolder/sub1/”结构时,重定向回主域。即 sub1.mydomain.com/subsrootfolder/sub1/() 正常服务,但如果 sub1.mydomain.com/() 被请求重定向到 www.mydomain.com/(*)
谢谢很多任何见解!
前任。
案例 1. sub1.domain.com --> sub1.domain.com/subrootfolder/sub1/
案例 2. sub1.domain.com/subrootfolder/sub1/* -->与情况 3 一样
。 sub1.domain.com/anyotherfolder/ --> www.domain.com/anyotherfolder/
案例 4. www.domain.com/subrootfolder/sub1/* --> sub1.domain.com/subrootfolder/sub1/*
也许这些示例比上面的文本更具解释性...:)
I have the following situation to tackle, i have a domain and a subdomain pointing to the same resource.
www.mydomain.com and sub1.mydomain.com
What i'm trying to achieve is the following:
i would like the subdomain to
redirect its root to a sub-folder of the system.
So sub1.mydomain.com --> sub1.mydomain.com/subdomainsrootfolder/sub1/redirect back to the main domain when a uri not below the "/subdomainsrootfolder/sub1/" structure is requested. i.e. sub1.mydomain.com/subsrootfolder/sub1/() to be served normally but if sub1.mydomain.com/() is requested to redirect to www.mydomain.com/(*)
thanks a lot for any insights!
ex.
case 1. sub1.domain.com --> sub1.domain.com/subrootfolder/sub1/
case 2. sub1.domain.com/subrootfolder/sub1/* --> as is
case 3. sub1.domain.com/anyotherfolder/ --> www.domain.com/anyotherfolder/
case 4. www.domain.com/subrootfolder/sub1/* --> sub1.domain.com/subrootfolder/sub1/*
maybe these examples are more explanatory than the text above... :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)