redirect all wildcard subdomains to root domain

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

    According to evan's blog, you might configure your ServerAlias with wildcard "*" if you make apache as your server side. Every visit to the subdomain will be redirected or routed to the root domain in this case.

    
    VirtualDocumentRoot "/path/to/your/workspace/%1/public"
    ServerName vhosts.dev
    ServerAlias *.dev
    UseCanonicalName Off
    
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    
    
    

提交回复
热议问题