【问题标题】:Two different URLs pointing to the same page指向同一页面的两个不同 URL
【发布时间】:2014-11-18 05:48:12
【问题描述】:

假设我有类似 http://www.example.com/pages/process-one.html 的 URL,我想在 .htaccess 中添加一个条目,让我可以使用 URL https://www.example.com/process/process-one.html 访问同一页面 - 所以人们将使用“进程”而不是“页面” .

【问题讨论】:

    标签: .htaccess url-masking


    【解决方案1】:

    RewriteEngine On
    RewriteRule /process/process-one.html /pages/process-one.html [L]

    根据您的服务器配置,您可能需要RewriteBase / 或其他名称。这个 htaccess 进入 /。

    【讨论】:

    • 感谢您的快速回复,我正在使用 magento,我尝试应用 rewriterule 但它不起作用。
    • 您还有其他最重要的规则吗?大多数大型 PHP 应用程序将消耗所有内容,采用 /* 的路线
    • 是的,我使用的是 Magento 生成的默认 htaccess。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 1970-01-01
    • 2019-02-07
    • 2022-08-16
    相关资源
    最近更新 更多