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

2023-09-02 09:46:01 作者:挽歌℡

此网址

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

将成为

example.com/videos/video-category

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

Also, there is pagination and limit url

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

和它会成为

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

此网址也适用

example.com/videos/video-category?page=2

example.com/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 ^(.*)$ http://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 ^(.*)$ http://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.