如何在 xampp localhost 中使用 PHP 和 htaccess 创建动态子域 我在 mysql 中存储了子域名,但我想在窗口平台的 xampp localhost 中进行如下检查
是指 http://example.com/subdomain?=alabaster
我想要这样 http://alabaster.example.com 通过本地主机 xampp 中的 php mysql 你会逐步解释吗
如何在本地主机 xampp 窗口中运行它
比x提前
最佳答案
你可以试试这段代码:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^subdomain=([^&]+)$
RewriteRule ^$ http://%1.example.com? [L,R=301]
这些链接可能对您有帮助:
关于php - 在 xampp localhost 中使用 PHP 和 htaccess 创建动态子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34694232/