redirect all wildcard subdomains to root domain

前端 未结 4 377
礼貌的吻别
礼貌的吻别 2020-12-06 02:48

Okay, I have done a fair amount of searching but still can\'t find something specific enough to handle my problem.

Right now I have a DNS record that redirects all o

4条回答
  •  离开以前
    2020-12-06 03:15

    In my case I need rule like foo.bar.com > bar.com/page/foo and I found in apache documentation this:

    RewriteCond %{HTTP_HOST} ^(.+)\.bar\.com$ [NC]
    RewriteCond %{HTTP_HOST} !www.bar.com$ [NC]
    RewriteRule ^(.*)$ http://bar.com/page/%1/$1 [L,R=301]
    

提交回复
热议问题