Using Subdirectory as subdomain in htaccess

前端 未结 2 1896
别跟我提以往
别跟我提以往 2020-12-22 06:20

I am trying to point a subfolder on my site as a subdomain. for example, i want to turn www.domain.com/test to test.domain.com. I already have some rewrites in htaccess done

相关标签:
2条回答
  • 2020-12-22 06:40

    Subdomains aren't so easy to set up. You will need to configure your server before. More informations here : Create subdomains on the fly with .htaccess (PHP)

    0 讨论(0)
  • 2020-12-22 06:55

    Try:

    RewriteCond %{HTTP_HOST} !^www.domain.tv [NC]
    RewriteCond %{HTTP_HOST} ([^\.]+).domain.tv [NC]
    RewriteRule ^(.*)$ %1/$1 [L]
    
    0 讨论(0)
提交回复
热议问题