简体   繁体   English

使用.htaccess重定向到另一个URL后如何重写URL

[英]How to rewrite URL after redirect to another url using .htaccess

I have problem to redirect page in paging system. 我在页面调度系统中重定向页面时遇到问题。 I have write .htaccess as follows. 我写了.htaccess如下。

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

Actually I want to add paging system in the news.html. 实际上,我想在news.html中添加分页系统。 But it is not working :( 但这不起作用:(

Please help me. 请帮我。

Probably final URI should be allnews.php?type=1&page=2 instead of allnews.php?type=1&page2 . 最终的URI可能应该是allnews.php?type=1&page=2而不是allnews.php?type=1&page2

RewriteEngine On

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM