1
是否有可能只的.htaccess做这类重定向:.htaccess的子域重定向
来自:http://domain.com/directory.php?ref=sub
到:http://sub.domain.com/directory.php
如果不是,我需要是什么?
是否有可能只的.htaccess做这类重定向:.htaccess的子域重定向
来自:http://domain.com/directory.php?ref=sub
到:http://sub.domain.com/directory.php
如果不是,我需要是什么?
检查教程
http://blog.gwebtools.com/apache-htaccess-subdomain-redirect-rules/
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([a-z0-9-]+)/? http://$1.domain.com [R=301,NC,L]
与您的域名替换 “domain.com” 的两个实例。