.htaccess subdomain url rewrite

后端 未结 2 1277
攒了一身酷
攒了一身酷 2020-12-22 07:26

I would like to rewrite an url, but I always do not get any adequate results.

I would like the url http://something.domain.com/index.php?arguments... to actually v

相关标签:
2条回答
  • 2020-12-22 07:41

    Thank you for the help! It seems that I do not have to add a wildcard dns entry, but to create a wildcard sub-domain in cpanel.

    0 讨论(0)
  • 2020-12-22 07:44

    You can use this code in your DOCUMENT_ROOT/.htaccess file of something domain:

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^([^.]+)\.(domain\.com)$ [NC]
    RewriteRule ^(index\.php)$ http://%2/$1?username=%1 [L,QSA,NC,R]
    
    0 讨论(0)
提交回复
热议问题