htaccess用斜线得到页面分页

www.example.com/category/ .htaccess

<Files .htaccess> order allow,deny </Files> Options +FollowSymLinks RewriteEngine On RewriteRule ^(\w+)/(.*)$ ./load.php?code=$1 RewriteRule ^(\w+)/*$ ./load.php?code=$1 

load.php

 <?php $code = $_GET['code']; echo $code.'<br/>'; echo $_GET['page']; ?> 

www.example.com/category/ 16598 <<这是'code' 。 用php echo $_GET['code']; 但如何显示'page' www.example.com/category/16598/video-title/ 2 <<这是'page'数字..如何显示与PHP echo $_GET['page'];

您可以使用:

 Options +FollowSymLinks RewriteEngine On RewriteBase /test/hta/ RewriteRule ^([0-9]+)(?:/[^/]+)?/?$ load.php?code=$1 [L,QSA] RewriteRule ^([0-9]+)/[^/]+/([0-9]+)/?$ load.php?code=$1&page=$2 [L,QSA] RewriteRule ^([0-9]+)/[^/]+/[^/]+/([0-9]+)/?$ load.php?code=$1&page=$2 [L,QSA]