繁体   English   中英

在xampp localhost中使用PHP和htaccess创建动态子域

[英]create dynamic sub domain using PHP & htaccess in xampp localhost

如何在xampp localhost中使用PHP和htaccess创建动态子域,我在mysql中存储了子域名,但我想像在Windows Platform中的xampp localhost中进行以下检查

表示http://example.com/subdomain?=alabaster

我想像这样的http://alabaster.example.com通过php mysql在localhost xampp中进行操作,您会逐步解释吗?

如何运行它localhost xampp窗口

前进比

您可以尝试以下代码:

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^subdomain=([^&]+)$
RewriteRule ^$ http://%1.example.com?  [L,R=301]

这些链接可能会帮助您:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM