创建页面作为子域,而不在服务器上创建子域
问题描述:
我在我的网站上有URL,例如http://example.com/test,我需要这个页面显示为子域,例如http://test.example.com/。创建页面作为子域,而不在服务器上创建子域
我试过以下的东西。
我在htaccess中设置了redirect 301
规则,但总是重定向到主页 。 Redirect 301 /test http://test.example.com/
我几乎很少使用的WordPress插件wp subdomain revisited和Main category as subdomain,但没有运气,所以也许他们是旧版本。
我已经设置了通配符子域(* .subdomain.com),并且该文件夹被设置为公共html主根目录。
请帮忙。
答
你需要在服务器和htaccess文件使用wilcard子域功能http://www.mediacollege.com/internet/server/apache/mod-rewrite/subdomains.html
+0
所以不是不足以在服务器端创建通配符子域(*。example.com)吗? – Asif
的可能的复制[如何让PHP为每个用户自动创建域名?](http://stackoverflow.com/questions/183928/如何让php-to-create-subdomain-automatically-for-each-user) – Rehmat