0

我使用 htaccess 中的以下代码重定向新闻:

RewriteCond %{REQUEST_URI} news-detail\.html
RewriteCond %{QUERY_STRING} L=0 [NC]
RewriteCond %{QUERY_STRING} (tx_news_pi1\[news\]=101|tx_news_pi1%5Bnews%5D=101) [NC]
RewriteRule ^.*$ http://example.net/news/news-detail/8/2016/newstitle? [R=301,L]

重定向有效。是否可以在 RewriteRule 中使用来自 QUERY_STRING 的参数?这样每篇新闻文章都会自动重定向到演讲网址。我尝试使用配置文件中的一些参数,但它不起作用。

4

1 回答 1

0

您不会仅通过 id uid 获得 htacces 中的新闻标题。

我建议保留原样的 url,使用 realurl 并将规范 url 设置为 realurl 变体

于 2016-08-12T17:55:35.943 回答