【问题标题】:How to rewrite URL after redirect to another url using .htaccess使用 .htaccess 重定向到另一个 URL 后如何重写 URL
【发布时间】:2014-02-21 08:02:39
【问题描述】:

我在分页系统中重定向页面时遇到问题。我已经写了 .htaccess 如下。

RewriteRule ^news.html?page=2 allnews.php?type=1&page2 [NC]
RewriteRule ^news.html allnews.php?type=1 [NC]

其实我想在news.html中添加分页系统。但它不起作用:(

请帮帮我。

【问题讨论】:

  • 抱歉第一行是 RewriteRule ^news.html?page=2 allnews.php?type=1&page=2 [NC]

标签: php .htaccess mod-rewrite


【解决方案1】:

可能最终的 URI 应该是 allnews.php?type=1&page=2 而不是 allnews.php?type=1&page2

RewriteEngine On

RewriteRule ^news\.html$ /allnews.php?type=1 [NC,QSA]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-04
    • 1970-01-01
    • 2013-03-13
    • 2015-10-28
    • 2013-09-08
    • 2015-03-01
    • 2021-07-22
    • 1970-01-01
    相关资源
    最近更新 更多