redirect all wildcard subdomains to root domain

前端 未结 4 378
礼貌的吻别
礼貌的吻别 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:18

    This article Covers .htacces and ModRewrite to redirect any request made to any domin other than the primary one redirect to the primary domain.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !www.newdomain.com$ [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301] 
    

提交回复
热议问题