获得价值日历和分页的hta​​ccess分页、日历、价值、ccess

2023-09-02 00:56:37 作者:男人不狠,江山不稳

我想添加分页htaccess的像这样。所以我把例子。底部有我的htaccess code。所以如何解决它喜欢这一点。帮我到这个职位。谢谢。

  

example.com/calendar/2014/page/2< - example.com/calendar/load.php?year=2014&page=2

     

example.com/calendar/2014/4/page/2< - example.com/calendar/load.php?year=2014&month=4&page=2

     

example.com/calendar/2014/4/27/page/2< - example.com/calendar/load.php?year=2014&month=4&date=27&page=2

在这里我的htaccess code

/calendar/.htaccess

 选项+了FollowSymLinks
RewriteEngine叙述上
的RewriteBase /日历/

的RewriteCond%{HTTP_HOST}!^ WWW 。 [NC]
重写规则^ HTTP://www.% {HTTP_HOST}%{REQUEST_URI} [R = 301,NE,L]

重写规则^([0-9] +)/ $ load.php?一年= $ 1 [L,QSA]

重写规则^([0-9] +)1 /([0-9] +)/ $ load.php年= $&放大器;?月= $ 2 [L,QSA]

2个月= $&功放; 1重写规则^([0-9] +)/([0-9] +)/([0-9] +)/ $ load.php年= $&放?日期= $ 3 [L ,QSA]
 

解决方案

您可以使用:

 选项+了FollowSymLinks
RewriteEngine叙述上
的RewriteBase /日历/

的RewriteCond%{HTTP_HOST}!^ WWW 。 [NC]
重写规则^ HTTP://www.% {HTTP_HOST}%{REQUEST_URI} [R = 301,NE,L]

重写规则^([0-9] +)/ $ load.php?一年= $ 1 [L,QSA]
1重写规则^([0-9] +)/(页)/([0-9] +)/ $ load.php年= $&安培; P = $ 3 [L,QSA]

重写规则^([0-9] +)1 /([0-9] +)/ $ load.php年= $&放大器;?月= $ 2 [L,QSA]
重写规则^([0-9] +)/([0-9] +)/(页)/ 1([0-9] +)/ $ load.php年= $&放大器;?月= $ 2和,P = $ 4 L,QSA]

2个月= $&功放; 1重写规则^([0-9] +)/([0-9] +)/([0-9] +)/ $ load.php年= $&放?日期= $ 3 [L ,QSA]
重写规则^([0-9] +)/([0-9] +)/([0-9] +)/(页)/([0-9] +)/ $ load.php?年= 2个月= $&放大器; $ 1和日期= $ 3及P = $ 5 L,QSA]
 

i want to add pagination for htaccess with like this. so i put examples. bottom has my htaccess code. so how to fix it to like this. help me to this post. thanks.

example.com/calendar/2014/page/2 <- example.com/calendar/load.php?year=2014&page=2

example.com/calendar/2014/4/page/2 <- example.com/calendar/load.php?year=2014&month=4&page=2

example.com/calendar/2014/4/27/page/2 <- example.com/calendar/load.php?year=2014&month=4&date=27&page=2

here my htaccess code

/calendar/.htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteBase /calendar/

RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]

RewriteRule ^([0-9]+)/?$ load.php?year=$1 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2&date=$3 [L,QSA]

解决方案

You can use:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /calendar/

RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]

RewriteRule ^([0-9]+)/?$ load.php?year=$1 [L,QSA]   
RewriteRule ^([0-9]+)/(page)/([0-9]+)/?$ load.php?year=$1&p=$3 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2 [L,QSA]
RewriteRule ^([0-9]+)/([0-9]+)/(page)/([0-9]+)/?$ load.php?year=$1&month=$2&p=$4 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2&date=$3 [L,QSA]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/(page)/([0-9]+)/?$ load.php?year=$1&month=$2&date=$3&p=$5 [L,QSA]