【发布时间】:2013-02-27 22:18:24
【问题描述】:
我想重写我网站上某些页面的 URL,因此 page.mysite.com 将导致 mysite.com/profiles/page
我该怎么做?
【问题讨论】:
-
我不知道为什么这个问题有这么多反对票 - 我觉得它看起来很合理,虽然很短。
标签: php .htaccess mod-rewrite
我想重写我网站上某些页面的 URL,因此 page.mysite.com 将导致 mysite.com/profiles/page
我该怎么做?
【问题讨论】:
标签: php .htaccess mod-rewrite
http://page.mysite.com 形式的 URL 是子域。您不能单独使用 .htaccess 来配置它们。您需要设置通配符 DNS 以将所有子域指向您的服务器。您还需要在服务器的 apache 配置中设置某种通配符虚拟主机。
一旦你完成了这项工作,请查看 apache mod_rewrite 示例中的 http://httpd.apache.org/docs/trunk/rewrite/vhosts.html。
【讨论】: