0

I would like to redirect

pins?board=10000011

to

view_photos.php?album=10000011

10000011 being an id that is dynamic, therefore the no clue in the title of this question, do not know how to grab that and use inside a rewrite rule.

have tried with:

RewriteRule ^([A-Za-z-0-9-_.]+)/pins?board= $1/view_photos.php?album=$2

it seems I obviously don't know exactly what I'm doing so I'm asking for help.

4

1 回答 1

0

您无法匹配重写规则中的查询字符串。您需要%{QUERY_STRING}在重写条件下使用 var:

RewriteCond %{QUERY_STRING} ^board=(.*)$
RewriteRule ^/?([A-Za-z-0-9-_.]+)/pins$ /$1/view_photos.php?album=%1 [L,R=301]
于 2013-08-20T00:58:34.087 回答