【问题标题】:Making friendlier URLs (using htaccess)? [closed]制作更友好的 URL(使用 htaccess)? [关闭]
【发布时间】:2013-02-27 22:18:24
【问题描述】:

我想重写我网站上某些页面的 URL,因此 page.mysite.com 将导致 mysite.com/profiles/page

我该怎么做?

【问题讨论】:

  • 我不知道为什么这个问题有这么多反对票 - 我觉得它看起来很合理,虽然很短。

标签: php .htaccess mod-rewrite


【解决方案1】:

http://page.mysite.com 形式的 URL 是子域。您不能单独使用 .htaccess 来配置它们。您需要设置通配符 DNS 以将所有子域指向您的服务器。您还需要在服务器的 apache 配置中设置某种通配符虚拟主机。

一旦你完成了这项工作,请查看 apache mod_rewrite 示例中的 http://httpd.apache.org/docs/trunk/rewrite/vhosts.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-24
    • 2014-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    • 1970-01-01
    • 2015-05-05
    相关资源
    最近更新 更多