url rewriting - Change pagination url format

I have a URL like this:exampleblogpage5I want to change it to:exampleblogpage-5I tried using a RewriteRule like thi

I have a URL like this:

example/blog/page/5

I want to change it to:

example/blog/page-5

I tried using a RewriteRule like this:

RewriteRule ^blog/page-([0-9]+) /blog/page/$1

but this returns 404 page not found. After a lot of debugging I realized that the reason it returns 404 is that the $_SERVER['REQUEST_URI'] in PHP stays blog/page-5 even after Apache rewrites it to blog/page/5.

It is possible to do it with redirection by adding [R] at the end of the RewriteRule but it will change the URL in browser to /blog/page/5, and I don't want that.

Any ideas?

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

相关推荐

  • url rewriting - Change pagination url format

    I have a URL like this:exampleblogpage5I want to change it to:exampleblogpage-5I tried using a RewriteRule like thi

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信