admin管理员组文章数量:1391768
I have a strange request I thought would be simple. I need to break the Wordpress pagination. Specifically, I need to make the /page/2/
, /page/3/
, and so on, links disabled.
I tried:
RewriteRule ^page/[0-9] [dot]com/404.php [R]
But that is a no go... Anyone?
Thanks
I have a strange request I thought would be simple. I need to break the Wordpress pagination. Specifically, I need to make the /page/2/
, /page/3/
, and so on, links disabled.
I tried:
RewriteRule ^page/[0-9] http://www.mysite[dot]com/404.php [R]
But that is a no go... Anyone?
Thanks
Share Improve this question edited Oct 12, 2016 at 16:51 Tom J Nowell♦ 61.2k7 gold badges79 silver badges148 bronze badges asked Oct 12, 2016 at 14:54 JADEComputerJADEComputer 214 bronze badges 3- This should be possible entirely within PHP/WordPress using rewrite rules ( modification of rewrite rules ), enabling an answer that works via a plugin across Nginx and Apache, as well as others. HTAccess knowledge shouldn't be needed or necessary – Tom J Nowell ♦ Commented Oct 12, 2016 at 16:49
- Also keep in mind that anybody can add the pagination query params manually to the end of the URL and continue using paging, it's not enough to disable the pretty URLs – Tom J Nowell ♦ Commented Oct 12, 2016 at 16:50
- Have you tried with the L flag, httpd.apache/docs/current/rewrite/flags.html#flag_l – Nabil Kadimi Commented Oct 12, 2016 at 21:11
2 Answers
Reset to default 1Thanks Nick! I thought that would work, and I placed it right after "RewriteEngine On" so it came first.
I did find a working solution for handling it though (after 2 hrs):
RewriteRule ^page/(.*)$ /$1 [G]
In case anyone else needs to do the same ...
That rule looks OK; the problem might be where you put it. Order matters in .htaccess, so be sure you're putting it in the right place. Check out this similar SO thread.
本文标签: url rewritingDisable Pagination on Pages
版权声明:本文标题:url rewriting - Disable Pagination on Pages 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744771115a2624345.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论