url rewriting - Disable Pagination on Pages

I have a strange request I thought would be simple. I need to break the Wordpress pagination. Specifically, I need to ma

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
Add a comment  | 

2 Answers 2

Reset to default 1

Thanks 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744771115a4592765.html

相关推荐

  • url rewriting - Disable Pagination on Pages

    I have a strange request I thought would be simple. I need to break the Wordpress pagination. Specifically, I need to ma

    16小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信