最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

redirect - wordpress automatic URL 'page' parameter rewrite

programmeradmin9浏览0评论

I have noticed that on my wordpress installation the page

domain/test?page=2 

is redirecting to

domain/test/2

I tried disabling all plugins and also used the default/different themes and the behavior exists nevertheless, why I am assuming that this is a wordpress behavior.

Is there any chance to prevent this redirect and keep the ?page parameter intact in the URL?

I have noticed that on my wordpress installation the page

domain/test?page=2 

is redirecting to

domain/test/2

I tried disabling all plugins and also used the default/different themes and the behavior exists nevertheless, why I am assuming that this is a wordpress behavior.

Is there any chance to prevent this redirect and keep the ?page parameter intact in the URL?

Share Improve this question asked Mar 26, 2020 at 18:22 TomTom 1114 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Any reason why you need to keep the ?page= in the url? If you just need to get the value of the page you can use:

// will return value after "paged" pages "test/page/2" $paged will be 2
$paged = get_query_var('page');
发布评论

评论列表(0)

  1. 暂无评论