获得价值htaccess以及分页的限制

编程入门 行业动态 更新时间:2024-10-24 12:27:17
本文介绍了获得价值htaccess以及分页的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

此网址

example/videos/load.php?cat=video-category

将成为

example/videos/video-category

此外,还有分页和限制网址

Also, there is pagination and limit url

example/videos/load.php?cat=video-category&p=2&limit=20

和它会成为

example/videos/video-category?page=2&limit=20

此网址也适用

example/videos/video-category?page=2 example/videos/video-category?limit=20

下面是我的htaccess(成视频文件夹)

Here is my htaccess (into videos folder)

Options +FollowSymLinks RewriteEngine on RewriteBase /videos/ RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ www.%{HTTP_HOST}/$1 [R=301,NE,L] RewriteRule ^([^/]+)/?$ load.php?cat=$1 [L,QSA] RewriteRule ^([^/]+)/page/?$ $1 [R=301,L] RewriteRule ^([^/]+)/page/([1-9][0-9]*)$ load.php?cat=$1&p=$2 [L,QSA]

怎么做.. plz帮助我..谢谢..

how to do this.. plz help me.. thanks..

推荐答案

想,也许您正在寻找这样的事情?

Think maybe you're looking for something like this?

Options +FollowSymLinks RewriteEngine on RewriteBase /videos/ RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ www.%{HTTP_HOST}/$1 [R=301,NE,L] RewriteCond %{THE_REQUEST} \ /+videos/load\.php\?cat=([^&\ ]+)&?([^\ ]*) RewriteRule ^ %1?%2 [L,R] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/?$ load.php?cat=$1 [L,QSA]

这是满足这个问题你问,但你的规则有工具和 /页/ ,这是不是你的问题的一部分都没有。

That satisfies the question you're asking, but your rules have stuff for /page/, which isn't part of your question at all.

更多推荐

获得价值htaccess以及分页的限制

本文发布于:2023-11-02 08:26:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551889.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分页   价值   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!